Hello, I´ll try to make a web app for a small business owners web
presence. I found cakephp as the right tool for fast development.

Now I have wrote my model and controller classes and the views. In the
layout I would like to switch the visability of the menu by a simple
Callback function.

Am I right using the beforeFilter for passing active state to the view
as in the example I found on,
http://old.nabble.com/beforeFilter-on-app_controller-and-on-posts_controller--td16543705.html,
google?

Ex:

app_controller before filter:
    function beforeFilter() {
                $this->set('SiteRoot', '/bla/');
                //default menu to nothing
                $this->set('MenuSelected', '0');
    }

post_controller before filter
    function beforeFilter() {
                parent::beforeFilter();
                $this->set('MenuSelected', '1');
    }



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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to