Esempio n. 1
0
 function init()
 {
     parent::init();
     if ($this->model) {
         if (!is_a($this->model, 'atk4\\atk4homepage\\Model_Page') || !$this->model->loaded()) {
             throw $this->exception('Set up proper model.');
         }
     } else {
         $this->model = $this->add('atk4\\atk4homepage\\Model_Page');
         $this->model->tryLoadBy('hash_url', $this->app->page);
         if (!$this->model->loaded()) {
             throw $this->exception('There is no such a page [' . $this->app->page . ']', 'atk4\\atk4homepage\\NoPage');
         }
     }
     $this->page_translation = $this->model->getTranslation(true);
     // This is dynamically added page, let's do everything we need
     // In other case user must do the same manually
     if (get_class($this) == 'atk4\\atk4homepage\\Page_Dynamic') {
         $this->addDynamicContent();
     }
 }