On 10 mayo, 00:13, soytuny [EMAIL PROTECTED] wrote:
You can render the home view with
$this-render('../pages/home');
IMO that's a bad habit that shouldn't be propogated - the unwary may
think it's an equivalent to using requestAction and will start doing
$this-render('../products/index');
Nice, that makes a lot of sense.
Since I'm writing the error message to the session anyway, there is no
reason to not forward.
I switched my code to:
$this-Session-setFlash('Validation failed.');
$this-redirect('../pages/home');
exit();
Hello,
I've created my default home page (/views/pages/home.thmtl) to include
a login form for my application. This works fine, but if the login
fails, I am unsure how to handle it. I would like to send the user
back to the front page and display an appropriate error message.
Here is my
You can render the home view with
$this-render('../pages/home');
If you would like to set an error message and redirect you can use
$this-Session-setFlash('You ain't no user!');
To display the flash message, you need this line in your layout (or
view)
if($session-check('Message.flash'))
Nice. I'm looking good :)
Thanks a lot!
2007/5/9, soytuny [EMAIL PROTECTED]:
You can render the home view with
$this-render('../pages/home');
If you would like to set an error message and redirect you can use
$this-Session-setFlash('You ain't no user!');
To display the flash