Topics

Class Content

Language, page, block and other content. Can be treated as a gateway to framework content.

Namespace: Ip

Methods:

__construct( )
Ip\Language getCurrentLanguage( )

Get current language object

Return values:

Ip\Language
Ip\Page getPage( mixed $pageId )

Parameters:

mixed $pageId

Return values:

Ip\Page
Ip\Page getPageByAlias( string $alias , [ string|null $languageCode = null ] )

Parameters:

string $alias
string|null $languageCode

Return values:

Ip\Page
Ip\Page getCurrentPage( )

Get current page object

Return values:

Ip\Page
boolean|Ip\Language getLanguage( integer $id )

Get specific language object

Parameters:

integer $id Language ID

Return values:

boolean|Ip\Language
null|Ip\Language getLanguageByCode( string $code )

Get specific language object

Parameters:

string $code Language code

Return values:

null|Ip\Language
Ip\Language[] getLanguages( )

Get all website languages

Return values:

Ip\Language[] All website languages. Each element is a Language object.
string getBlockContent( string $block )

Get page block HTML content

Parameters:

string $block Block name

Return values:

string HTML code
setBlockContent( string $block , string $content )

Set page block HTML content

Parameters:

string $block Block name
string $content HTML code
Ip\Block generateBlock( string $blockName )

Generate block object

Parameters:

string $blockName

Return values:

Ip\Block
Ip\Page[] getBreadcrumb( [ integer $pageId = null ] )

Get a breadcrumb

Gets an array of pages representing a tree path to a current page.

Parameters:

integer $pageId

Return values:

Ip\Page[]
string getTitle( )

Get a page title

Return values:

string Title of the current page
string getDescription( )

Get the current page description

Return values:

string Description of the current page
string getKeywords( )

Get the current page keywords

Return values:

string Keywords for the current page
mixed addLanguage( string $title , string $abbreviation , string $code , string $url , boolean $visible , [ string $textDirection = 'ltr' ] , [ null $position = null ] )

Add website language

Parameters:

string $title
string $abbreviation
string $code
string $url
boolean $visible
string $textDirection
null $position

Return values:

mixed
deleteLanguage( mixed $languageId )

Delete a language with specific ID

Parameters:

mixed $languageId
updatePage( integer $pageId , array $data )

Update page data

Parameters:

integer $pageId
array $data
mixed addPage( integer $parentId , string $title , [ array $data = array() ] )

Add a new page

Parameters:

integer $parentId Parent page ID
string $title
array $data

Return values:

mixed
integer copyPage( integer $pageId , integer $destinationParentId , integer $destinationPosition )

Copy page

Parameters:

integer $pageId Source page ID
integer $destinationParentId Target parent ID
integer $destinationPosition

Return values:

integer New copied page ID
movePage( integer $pageId , integer $destinationParentId , integer $destinationPosition )

Move a page to a different location on a website tree

Parameters:

integer $pageId Source page ID
integer $destinationParentId Target parent ID
integer $destinationPosition
deletePage( integer $pageId )

Delete a page

Parameters:

integer $pageId
Ip\Page[] getChildren( [ null $parentId = null ] , [ null $from = null ] , [ null $till = null ] , [ string $orderBy = 'pageOrder' ] , [ string $direction = 'ASC' ] )

Get children

Parameters:

null $parentId
null $from
null $till
string $orderBy
string $direction

Return values:

Ip\Page[]
Ip\Page getPageMenu( [ null $pageId = null ] )

Get menu of currently active or specified page. This method could be used to check if page is in some of menus or not. Eg. if (ipContent()->getPageMenu()->getAlias() == 'menu1') //if current page is one of pages in menu1

Parameters:

null $pageId

Return values:

Ip\Page
Ip\Page[] getMenus( [ string $languageCode = null ] )

Get menus of the website. Menu list may be different on each language. That's why there is $languageCode parameter. If $languageCode is omitted, current language is used by default.

Parameters:

string $languageCode

Return values:

Ip\Page[]
Ip\Page getMenu( string $languageCode , string $alias )

Get menu.

Parameters:

string $languageCode
string $alias unique menu identificator within the language

Return values:

Ip\Page
integer addMenu( mixed $languageCode , mixed $alias , mixed $title , [ string $type = 'tree' ] )

Parameters:

mixed $languageCode
mixed $alias
mixed $title
string $type 'tree' or 'list'

Return values:

integer
deleteMenu( mixed $languageCode , mixed $alias )

Parameters:

mixed $id menu id
comments powered by Disqus