| View previous topic :: View next topic |
| Author |
Message |
Peter Pitt
Joined: 20 May 2006 Posts: 114 Location: Egypt
|
| How can i create an add function that doesn't show up the confirmation text via flash, but onto the same view? |
| |
|
|
|
|
montanarry
Joined: 13 May 2006 Posts: 175
|
| ~apilookup setflash |
| |
|
|
Peter Pitt
Joined: 20 May 2006 Posts: 114 Location: Egypt
|
No, i mean... like instead of loading a new page, it just shows a message on the view
In case that they want to add some more |
| |
|
|
montanarry
Joined: 13 May 2006 Posts: 175
|
Need to explain it more
Using ajax? |
| |
|
|
Peter Pitt
Joined: 20 May 2006 Posts: 114 Location: Egypt
|
Hmm... no
For example, on the tutorial
When you add a post, it sends you to a new page (via flash)
I would like to load the add view and show a confirmation message instead of the other page |
| |
|
|
montanarry
Joined: 13 May 2006 Posts: 175
|
| And the models are in svn also |
| |
|
|
Peter Pitt
Joined: 20 May 2006 Posts: 114 Location: Egypt
|
| No need to keep the data, as the entry was added |
| |
|
|
AmeliaR
Joined: 31 May 2006 Posts: 142
|
| Peter Pitt, what about a JS alert? |
| |
|
|
montanarry
Joined: 13 May 2006 Posts: 175
|
| Peter Pitt, $this->redirect('/same/page'); |
| |
|
|
Peter Pitt
Joined: 20 May 2006 Posts: 114 Location: Egypt
|
| I want to keep the use of javascript at the minimun |
| |
|
|
montanarry
Joined: 13 May 2006 Posts: 175
|
Simple
And the setFlash method |
| |
|
|
|
|
Peter Pitt
Joined: 20 May 2006 Posts: 114 Location: Egypt
|
| Call me stupid, but i couldn't figure out the setFlash |
| |
|
|
montanarry
Joined: 13 May 2006 Posts: 175
|
| Peter Pitt, did you look at the API? |
| |
|
|
Peter Pitt
Joined: 20 May 2006 Posts: 114 Location: Egypt
|
| Yep |
| |
|
|
montanarry
Joined: 13 May 2006 Posts: 175
|
$this->Session->setFlash('Message to show when page is displayed again');
Did you create your own layout? |
| |
|
|
Peter Pitt
Joined: 20 May 2006 Posts: 114 Location: Egypt
|
Before the redirect, i suppose
Nope |
| |
|
|
montanarry
Joined: 13 May 2006 Posts: 175
| |
Peter Pitt
Joined: 20 May 2006 Posts: 114 Location: Egypt
|
Ok... i'm getting a warning when trying to do validation
Warning: preg_match() [function.preg-match]: Delimiter must not be alphanumeric or backslash in C:\Program Files\xampp\htdocs\cake\cake\libs\model\model_php5.php on line 1458
Fixed, sorry |
| |
|
|
montanarry
Joined: 13 May 2006 Posts: 175
|
| User error |
| |
|
|
Peter Pitt
Joined: 20 May 2006 Posts: 114 Location: Egypt
|
Yep
What's $_crumbs on htmlHelper?
It says that it is a public attribute and an array, but no more info on that |
| |
|
|
|