|
Cms_Page class
Represents a CMS page.
Cms_Page class represents a front-end website page.
See AlsoPublic propertiesShow inherited properties.
Public methodsShow inherited methods.
Events
Property details¶ content propertypublic string $content;
Contains the page content source code.
Use get_content_code() method instead of accessing
this property directly. The property reflects the database value, which can be not actual if the
file-based templates mode
is enabled.
¶ description propertypublic string $description;
Contains the page description.
¶ id propertypublic integer $id;
Specifies the page identifier in the database.
¶ is_published propertypublic boolean $is_published;
Determines whether the page is published.
Unpublished pages are not visible on the front-end website.
¶ keywords propertypublic string $keywords;
Contains the page keywords.
¶ navigation_label propertypublic string $navigation_label;
Specifies the page navigation label for site maps and generated menus.
¶ navigation_visible propertypublic string $navigation_visible;
Determines whether the page is visible in the site maps and generated menus.
¶ protocol propertypublic string $protocol;
Specifies a protocol the page can be accessed by.
By default all pages can be accessed by any protocol. The propety
accepts the following values:
¶ title propertypublic string $title;
Specifies the page title.
¶ url propertypublic string $url;
Specifies the page URL relative to the application root.
Method details¶ findByUrl() methodpublic static mixed findByUrl(string $url, array &$params)
Returns a page by its URL.
Resolves an URL and returns the page object corresponding that URL.
Please note that the method finds pages in context of the currently active theme.
The following code example tries to find a page with URL /categories/computers. If there was a page with URL /categories it would be returned and the $params array would contain a single element computers: $params = array(); $page = Cms_Page::findByUrl('/categories/computers', $params); ¶ find_by_action_reference() methodpublic Cms_Page find_by_action_reference(string $action)
Finds a page by action name.
This method allows to find a page which uses a specific action.
Please note that the method finds pages in context of the currently active theme.
The following example finds the product page:
$page = Cms_Page::find_by_action_reference('shop:product'); ¶ find_by_id() methodpublic static Cms_Page find_by_id(integer $id)
Finds a page by its identifier.
This method uses internal caching, and it is recommendable
to use it instead of direct ActiveRecord calls/
¶ get_ajax_handlers_code() methodpublic string get_ajax_handlers_code(boolean $remove_php_wrap=false)
Returns the page AJAX handlers code string
This method loads the code string from a file if the
file-based templates mode
is enabled. If it is disabled, it returns the database field content.
¶ get_content_block_content() methodpublic string get_content_block_content(string $code)
Returns content of a content block content by its code.
Behavior of this method can be affected by cms:onGetPageBlockContent event handler.
¶ get_content_code() methodpublic string get_content_code()
Returns the page content code string
This method loads the code string from a file if the
file-based templates mode
is enabled. If it is disabled, it returns the database field content.
The result of this method can be affected by cms:onGetPageContent event.
¶ get_head_code() methodpublic string get_head_code()
Returns the page head declarations code string
This method loads the code string from a file if the
file-based templates mode
is enabled. If it is disabled, it returns the database field content.
¶ get_post_action_code() methodpublic string get_post_action_code(boolean $remove_php_wrap=false)
Returns the POST action code string.
This method loads the code string from a file if the
file-based templates mode
is enabled. If it is disabled, it returns the database field content.
¶ get_pre_action_code() methodpublic string get_pre_action_code(boolean $remove_php_wrap=false)
Returns the PRE action code string.
This method loads the code string from a file if the
file-based templates mode
is enabled. If it is disabled, it returns the database field content.
¶ navigation_label() methodpublic string navigation_label()
Returns the navigation menu label.
If the navigation menu label was not specified for this page, the function returns the page title.
¶ navigation_parents() methodpublic array navigation_parents(boolean $include_this=true)
Returns a list of the page navigation parents.
You can use this method for generating bread crumb navigation.
¶ navigation_root_pages() methodpublic static array navigation_root_pages()
Returns a list of navigation root pages.
¶ navigation_subpages() methodpublic array navigation_subpages()
Returns a list of pages grouped under this page.
¶ visible_for_customer_group() methodpublic boolean visible_for_customer_group(integer $group_id)
Determines whether the page is visible for a specific customer group.
|