protected function beforeRender()
 {
     parent::beforeRender();
     if (isset($this->model)) {
         $this->template->model = $this->model;
         $this->template->relativePath = $this->model->getRelativePath();
     }
     $this->setTemplateConfig();
     if (!isset($this->template->errors)) {
         $this->template->errors = array();
     }
     $this->loadWebModule('FlashMsgsWebModule', Environment::getConfig('webmodules')->flashMessages->skin);
 }