Core_Page
extends Core_Servant_Properties
in package
Frontend data, e.g. title, description, template and data hierarchy
Доступные методы:
- fileTimestamp(TRUE|FALSE) использовать в качестве временной метки дату файла, а не дату изменения макета, по умолчанию FALSE.
- compress(TRUE|FALSE) использовать компрессию, по умолчанию TRUE. Требует модуль "Компрессия страниц".
- doctype('html'|'xhtml') используемый DOCTYPE, влияет на формирование мета-тегов.
// Get Title
$title = Core_Page::instance()->title;
// Set Title
Core_Page::instance()->title('New title');
// Get description
$description = Core_Page::instance()->description;
// Set description
Core_Page::instance()->description('New description');
// Get keywords
$keywords = Core_Page::instance()->keywords;
// Set keywords
Core_Page::instance()->keywords('New keywords');
// Get Template object
$oTemplate = Core_Page::instance()->template;
var_dump($oTemplate->id);
// Get Structure object
$oStructure = Core_Page::instance()->structure;
var_dump($oStructure->id);
// Get Core_Response object
$oCore_Response = Core_Page::instance()->response;
// Set HTTP status
$oCore_Response->status(404);
// Get array of lib params
$array = Core_Page::instance()->libParams;
// Get controller object
$object = Core_Page::instance()->object;
if (is_object(Core_Page::instance()->object)
&& get_class(Core_Page::instance()->object) == 'Informationsystem_Controller_Show')
{
$Informationsystem_Controller_Show = Core_Page::instance()->object;
}
Tags
Table of Contents
Properties
- $css : array<string|int, mixed>
- Linking css
- $instance : mixed
- The singleton instances.
- $js : array<string|int, mixed>
- Linking js
- $_allowedProperties : array<string|int, mixed>
- Allowed object properties
- $_children : array<string|int, mixed>
- Children entities
- $_currentObject : mixed
- Current executing object
- $_frontendExecutionTimes : array<string|int, mixed>
- frontendExecutionTimes
- $_propertiesValues : array<string|int, mixed>
- Properties values
- $_unlimitedProperties : bool
- Object has unlimited number of properties
Methods
- __construct() : mixed
- Constructor.
- addAllowedProperties() : self
- Add additional allowed properties
- addAllowedProperty() : self
- Add additional allowed property
- addChild() : self
- Add child to an hierarchy
- addFrontendExecutionTimes() : self
- Add Frontend Execution Time
- addFrontentExecutionTimes() : mixed
- Fix name bug
- addTemplates() : self
- Add templates
- clearCss() : self
- Clear $css list
- clearJs() : self
- Clear $js list
- css() : self
- Link $css onto the end of array
- deleteChild() : self
- Delete first child
- error403() : self
- Show 403 error
- error404() : self
- Show 404 error
- execute() : mixed
- Executes the business logic.
- getChildren() : array<string|int, mixed>
- Get children
- getCss() : string
- Get block of linked css and clear added CSS list
- getCurrentObject() : mixed
- Get current executing object
- getFrontendExecutionTimes() : array<string|int, mixed>
- Get array of Frontend Execution Time
- getJs() : string
- Get block of linked JS and clear added JS list
- instance() : object
- Register an existing instance as a singleton.
- js() : self
- Link js
- prepareByStructure() : self
- Prepare Core_Page by Structure
- prependCss() : self
- Link $css to the beginning of list
- prependJs() : self
- Link $js to the beginning of list
- set() : self
- Run when writing data to inaccessible properties
- setUnlimitedProperties() : self
- Set unlimitedProperties
- showCss() : self
- Show block of linked css and clear added CSS list
- showDescription() : self
- Show page description
- showJs() : self
- Show block of linked JS and clear added JS list
- showKeywords() : self
- Show page keywords
- showTitle() : self
- Show page title
- _getCss() : string
- Get block of linked css
- _getCssCompressed() : string
- Get block of linked compressed css
- _getJs() : string
- Get block of linked js
- _getJsCompressed() : string
- Get block of linked compressed js
- _getMode() : string
- Get JS mode
Properties
$css
Linking css
public
array<string|int, mixed>
$css
= array()
$instance
The singleton instances.
public
static mixed
$instance
= \NULL
$js
Linking js
public
array<string|int, mixed>
$js
= array()
$_allowedProperties
Allowed object properties
protected
array<string|int, mixed>
$_allowedProperties
= array('doctype', 'title', 'description', 'keywords', 'template', 'structure', 'response', 'libParams', 'widgetParams', 'object', 'buildingPage', 'fileTimestamp', 'compress', 'cssCDN', 'jsCDN', 'informationsystemCDN', 'shopCDN', 'structureCDN')
$_children
Children entities
protected
array<string|int, mixed>
$_children
= array()
$_currentObject
Current executing object
protected
mixed
$_currentObject
= \NULL
$_frontendExecutionTimes
frontendExecutionTimes
protected
array<string|int, mixed>
$_frontendExecutionTimes
= array()
$_propertiesValues
Properties values
protected
array<string|int, mixed>
$_propertiesValues
= array()
$_unlimitedProperties
Object has unlimited number of properties
protected
bool
$_unlimitedProperties
= \FALSE
Methods
__construct()
Constructor.
public
__construct() : mixed
addAllowedProperties()
Add additional allowed properties
public
addAllowedProperties(array<string|int, mixed> $array) : self
Parameters
- $array : array<string|int, mixed>
-
array of properties' names
Return values
selfaddAllowedProperty()
Add additional allowed property
public
addAllowedProperty(string $property) : self
Parameters
- $property : string
-
property name
Return values
selfaddChild()
Add child to an hierarchy
public
addChild(object $object) : self
Parameters
- $object : object
-
object
Return values
selfaddFrontendExecutionTimes()
Add Frontend Execution Time
public
addFrontendExecutionTimes(mixed $value) : self
Parameters
- $value : mixed
Return values
selfaddFrontentExecutionTimes()
Fix name bug
public
addFrontentExecutionTimes(mixed $value) : mixed
Parameters
- $value : mixed
addTemplates()
Add templates
public
addTemplates(Template_Model $oTemplate) : self
Parameters
- $oTemplate : Template_Model
-
Template
Return values
selfclearCss()
Clear $css list
public
clearCss() : self
Return values
selfclearJs()
Clear $js list
public
clearJs() : self
Return values
selfcss()
Link $css onto the end of array
public
css(string $css) : self
Parameters
- $css : string
-
path
Return values
selfdeleteChild()
Delete first child
public
deleteChild() : self
Return values
selferror403()
Show 403 error
public
error403() : self
Tags
Return values
selferror404()
Show 404 error
public
error404() : self
Tags
Return values
selfexecute()
Executes the business logic.
public
execute() : mixed
getChildren()
Get children
public
getChildren() : array<string|int, mixed>
Return values
array<string|int, mixed>getCss()
Get block of linked css and clear added CSS list
public
getCss([bool $bExternal = TRUE ]) : string
Parameters
- $bExternal : bool = TRUE
-
add as link
Tags
Return values
stringgetCurrentObject()
Get current executing object
public
getCurrentObject() : mixed
getFrontendExecutionTimes()
Get array of Frontend Execution Time
public
getFrontendExecutionTimes() : array<string|int, mixed>
Return values
array<string|int, mixed>getJs()
Get block of linked JS and clear added JS list
public
getJs([bool $mode = FALSE ]) : string
Parameters
- $mode : bool = FALSE
-
async|defer|TRUE|FALSE, default FALSE
Tags
Return values
stringinstance()
Register an existing instance as a singleton.
public
static instance() : object
Return values
objectjs()
Link js
public
js(string $js[, bool $mode = FALSE ]) : self
Parameters
- $js : string
-
path
- $mode : bool = FALSE
-
async|defer|TRUE|FALSE, default FALSE
Return values
selfprepareByStructure()
Prepare Core_Page by Structure
public
prepareByStructure(Structure_Model $oStructure) : self
Parameters
- $oStructure : Structure_Model
Return values
selfprependCss()
Link $css to the beginning of list
public
prependCss(string $css) : self
Parameters
- $css : string
-
path
Return values
selfprependJs()
Link $js to the beginning of list
public
prependJs(string $js[, bool $mode = FALSE ]) : self
Parameters
- $js : string
-
path
- $mode : bool = FALSE
-
async|defer|TRUE|FALSE, default FALSE
Return values
selfset()
Run when writing data to inaccessible properties
public
set(string $property, string $value) : self
Parameters
- $property : string
-
property name
- $value : string
-
property value
Return values
selfsetUnlimitedProperties()
Set unlimitedProperties
public
setUnlimitedProperties([bool $value = TRUE ]) : self
Parameters
- $value : bool = TRUE
-
default TRUR
Return values
selfshowCss()
Show block of linked css and clear added CSS list
public
showCss([bool $bExternal = TRUE ]) : self
Parameters
- $bExternal : bool = TRUE
-
add as link
Tags
Return values
selfshowDescription()
Show page description
public
showDescription() : self
Return values
selfshowJs()
Show block of linked JS and clear added JS list
public
showJs([bool $mode = FALSE ]) : self
Parameters
- $mode : bool = FALSE
-
async|defer|TRUE|FALSE, default FALSE
Tags
Return values
selfshowKeywords()
Show page keywords
public
showKeywords() : self
Return values
selfshowTitle()
Show page title
public
showTitle() : self
Return values
self_getCss()
Get block of linked css
protected
_getCss([bool $bExternal = TRUE ]) : string
Parameters
- $bExternal : bool = TRUE
-
add as link, default TRUE
Return values
string_getCssCompressed()
Get block of linked compressed css
protected
_getCssCompressed([bool $bExternal = TRUE ]) : string
Parameters
- $bExternal : bool = TRUE
-
add as link, default TRUE
Return values
string_getJs()
Get block of linked js
protected
_getJs([bool $mode = FALSE ]) : string
Parameters
- $mode : bool = FALSE
-
async|defer|TRUE|FALSE, default FALSE
Return values
string_getJsCompressed()
Get block of linked compressed js
protected
_getJsCompressed([bool $mode = FALSE ]) : string
Parameters
- $mode : bool = FALSE
-
async|defer|TRUE|FALSE, default FALSE
Return values
string_getMode()
Get JS mode
protected
_getMode( $mode) : string