Controller_Template_Admin::before PHP Метод

before() публичный Метод

Configure admin controller
public before ( )
    public function before()
    {
        parent::before();
        // Load admin config
        $this->_config = Kohana::config('admin');
        if ($this->auto_render) {
            // Prepare templates
            $this->template = View::factory($this->_config['template'] . '/template');
            $this->template->header = View::factory($this->_config['template'] . '/header');
            $this->template->menu = View::factory($this->_config['template'] . '/menu');
            $this->template->footer = View::factory($this->_config['template'] . '/footer');
            $this->template->content = '';
            // Bind menu items
            $this->template->menu->bind('links', $this->_config['menu']);
            // Prepare media arrays
            $this->template->set_global('styles', array());
            $this->template->set_global('scripts', array());
        }
    }

Usage Example

Пример #1
0
 public function before()
 {
     parent::before();
     $this->user = Auth::instance()->get_user();
     $this->template->title = __('Unimasters User Profile');
     $this->template->active = 'profile';
 }
All Usage Examples Of Controller_Template_Admin::before
Controller_Template_Admin