<?php echo $session->flash(); ?>
And
<?php echo $this->Session->flash(); ?>
Are exactly the same - from 1.3 you should use second notation.
<?php echo $session->flash('auth'); ?>
This display flash message with key 'auth'.
On 10 Lip, 17:40, Hugo M <[email protected]> wrote:
> What's the difference between:
>
> <?php echo $session->flash(); ?>
> <?php echo $session->flash('auth'); ?>
>
> and
>
> <?php echo $this->Session->flash(); ?>
>
> 2010/7/9 Hugo M <[email protected]>
>
>
>
> > Hi all! I'm having a problem with the Auth component, is not showing login
> > errors :S. Here's my code:
>
> > *App controller:*
>
> > var $components = array('Auth', 'Session');
>
> > function beforeFilter() {
> > $this->Auth->logoutRedirect = array('controller' => 'deliveries',
> > 'action' => 'index');
> > $this->Auth->loginError = "Wrong user and password combination";
> > $this->set('loggedin', !!$this->Auth->User());
> > }
>
> > *Users controller:*
>
> > var $components = array('Session');
> > var $helpers = array('Javascript');
>
> > function beforeFilter() {
> > parent::beforeFilter();
> > $this->Auth->allow('register', 'login', 'logout', 'create',
> > 'modal_login', 'modal_register');
> > }
>
> > function login() {
>
> > }
>
> > A debug in session when I do a good login and a bad password is the same:
>
> > Array
> > (
> > [Config] => Array
> > (
> > [userAgent] => <USERAGENT>
> > [time] => 1278738789
> > [timeout] => 100
> > )
>
> > [Message] => Array
> > (
> > )
>
> > [Auth] => Array
> > (
> > )
>
> > )
>
> > *default.ctp Layout:*
>
> > <?php echo $this->Session->flash(); ?>
>
> > <?php
> > echo $session->flash();
> > echo $session->flash('auth');
> > ?>
>
> > <?php echo $content_for_layout; ?>
>
> > (I don't understand why I have to put both $session->flash() and
> > $this->Session->flash())
>
> > I'm using cakePHP 1.3
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en