Thanks for your answer. But now i have an error calling de plugin:

Fatal error: Class 'Plugin_Layout' not found in
/home/zerego/application/Bootstrap.php on line 8

application/plugins/Layout.php:

    class Layout extends Zend_Controller_Plugin_Abstract
    {
        public function preDispatch()
        {
                $user = Zend_Auth::getInstance();
            $role = $user->getIdentity()->role;
            $layout = Zend_Layout::getMvcInstance();
    
            switch ($role) {
                case 'admin':
                    $layout->setLayout('layout2');
                    break;
    
                case 'normal':
                    $layout->setLayout('layout');
                    break;
    
                default:
                    $layout->setLayout('layout');
                    break;
            }
        }
    }

application/Bootstrap.php:


    class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
    {
        protected function _initPlugins()
        {
        $front = Zend_Controller_Front::getInstance();
        $front->registerPlugin(new Plugin_Layout());
        }
    }


Sorry but i´m learning zend and OOP by my self. If you can help me again...
:D  


--
View this message in context: 
http://zend-framework-community.634137.n4.nabble.com/Change-layout-in-bootstrap-tp3475680p3478808.html
Sent from the Zend Framework mailing list archive at Nabble.com.

--
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]


Reply via email to