beforeFilter
And assigning `logged_in` in 'ObAuth' Comp.
On Dec 20, 11:45 am, NeoWebTech <deva.in...@gmail.com> wrote:
> Hello!
>
> I am PHP Developer for some time and developing my second CakePHP App
> now :)
>
> I am getting the following error when I access $logged_in from
> default.ctp.
>
> Notice (8): Undefined variable: logged_in [APP\views\layouts
> \default.ctp, line 17]
>
> Also this happens only when no corresponding action defined in
> controller which actually is 404 in production but I still want to
> access the variable. How can I do this?
>
> This the code in default.cpt
>
> <?php e($logged_in); ?>
>
> I set $logged_in AppController'sbeforeFilterfunction. Following the
> whole code:
>
> class AppController extends Controller {
>
> var $components = array('ObAuth');
>
> functionbeforeFilter() {
>
> $this->set("logged_in", $this->logged_in);
>
> return true;
> }
>
>
>
> }
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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
No comments:
Post a Comment