| View previous topic :: View next topic |
| Author |
Message |
montanarry
Joined: 13 May 2006 Posts: 175
|
| How can i create an add function that doesn't show up the confirmation text via flash, but onto the same view? |
| |
|
|
|
|
Ikopar
Joined: 26 May 2006 Posts: 168
|
Just corrected the image
~apilookup setflash |
| |
|
|
montanarry
Joined: 13 May 2006 Posts: 175
|
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 |
| |
|
|
Ikopar
Joined: 26 May 2006 Posts: 168
|
Need to explain it more
Using ajax? |
| |
|
|
montanarry
Joined: 13 May 2006 Posts: 175
|
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 |
| |
|
|
Ikopar
Joined: 26 May 2006 Posts: 168
|
| And the models are in svn also |
| |
|
|
montanarry
Joined: 13 May 2006 Posts: 175
|
| No need to keep the data, as the entry was added |
| |
|
|
BigDaddy
Joined: 26 May 2006 Posts: 147
|
| montanarry, what about a JS alert? |
| |
|
|
Ikopar
Joined: 26 May 2006 Posts: 168
|
| montanarry, $this->redirect('/same/page'); |
| |
|
|
montanarry
Joined: 13 May 2006 Posts: 175
|
| I want to keep the use of javascript at the minimun |
| |
|
|
Ikopar
Joined: 26 May 2006 Posts: 168
|
Simple
And the setFlash method |
| |
|
|
|
|
montanarry
Joined: 13 May 2006 Posts: 175
|
| Call me stupid, but i couldn't figure out the setFlash |
| |
|
|
Ikopar
Joined: 26 May 2006 Posts: 168
|
| montanarry, did you look at the API? |
| |
|
|
montanarry
Joined: 13 May 2006 Posts: 175
|
| Yep |
| |
|
|
Ikopar
Joined: 26 May 2006 Posts: 168
|
$this->Session->setFlash('Message to show when page is displayed again');
Did you create your own layout? |
| |
|
|
montanarry
Joined: 13 May 2006 Posts: 175
|
Before the redirect, i suppose
Nope |
| |
|
|
Ikopar
Joined: 26 May 2006 Posts: 168
| |
montanarry
Joined: 13 May 2006 Posts: 175
|
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 |
| |
|
|
Ikopar
Joined: 26 May 2006 Posts: 168
|
| User error |
| |
|
|
montanarry
Joined: 13 May 2006 Posts: 175
|
| Yep |
| |
|
|
|