public function on_page_load() { parent::on_page_load(); if (Request::current()->method() == Request::POST) { return $this->_check_password(); } }
/** * Метод запускается после того, как страница была найдена, виджеты * проинициализированы, до вывода шаблона страницы. * * @see Context::init_widgets() */ public function on_page_load() { parent::on_page_load(); //.... // В этот момент можно например произвести изменения в странице, передать // // $page = $this->_ctx->get_page(); // $page->... }
public function on_page_load() { parent::on_page_load(); $this->widget = $this->_ctx->get_widget($this->related_widget_id); $this->pagination = Pagination::factory(); if (!$this->widget instanceof Model_Widget_Decorator) { return FALSE; } $this->pagination->setup(array('items_per_page' => $this->widget->list_size, 'total_items' => $this->widget->count_total(), 'current_page' => array('source' => 'query_string', 'key' => $this->query_key))); $this->widget->list_offset = (int) $this->pagination->offset; }
public function on_page_load() { parent::on_page_load(); $user = $this->get_user(); if (!$user->loaded() and $this->throw_404 === TRUE) { $this->_ctx->throw_404('Profile not found'); } $page = $this->_ctx->get_page(); $page->meta_params(array('profile_username' => $user->username)); $this->_ctx->set('widget_profile_id', $user->id); $this->_ctx->set('widget_profile_username', $user->username); }
public function on_page_load() { parent::on_page_load(); $doc = $this->get_document(); if (empty($doc) and $this->throw_404) { $this->_ctx->throw_404(); } if ($this->seo_information === TRUE) { $page = $this->_ctx->get_page(); $page->meta_params('document_header', $doc['header'], 'title'); $page->meta_params('document_meta_title', $doc['meta_title'], 'meta_title'); $page->meta_params('document_meta_keywords', $doc['meta_keywords'], 'meta_keywords'); $page->meta_params('document_meta_description', $doc['meta_description'], 'meta_description'); } }