PHP Класс Frontend\Core\Engine\TemplateModifiers

Наследование: extends Common\Core\Twig\Extensions\BaseTwigModifiers
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
cleanupPlainText ( string $string ) : string Formats plain text as HTML, links will be detected, paragraphs will be inserted syntax: {{ $string|cleanupPlainText }}.
count ( array $data ) : integer Returns the count of the count of the array.
formatDate ( integer $var ) : string Format a UNIX-timestamp as a date syntax: {{ $var|formatdate }}
formatDateTime ( integer $var ) : string Format a UNIX-timestamp as a date syntax: {{ $var|formatdatetime }}
formatFloat ( float $number, integer $decimals = 2 ) : string Format a number as a float syntax: {{ $number|formatfloat($decimals) }}
formatNumber ( float $string, integer $decimals = null ) : string Format a number syntax: {{ $string|formatnumber($decimals) }}
formatTime ( integer $var ) : string Format a UNIX-timestamp as a date syntax: {{ $var|formatdate }}
getNavigation ( string $type = 'page', integer $parentId, integer $depth = null, string $excludeIds = null, string $template = '/Core/Layout/Templates/Navigation.html.twig' ) : string Get the navigation html syntax: {{ getnavigation($type, $parentId, $depth, $excludeIds-splitted-by-dash, $template) }}
getPageInfo ( integer $pageId, string $field = 'title' ) : string Get a given field for a page-record syntax: {{ $pageId|getpageinfo($field) }}
getPath ( string $file ) : string Fetch the path for an include (theme file if available, core file otherwise) syntax: {{ getpath($file) }}
getSubNavigation ( string $type = 'page', integer $pageId, integer $startDepth = 1, integer $endDepth = null, string $excludeIds = null, string $template = '/Core/Layout/Templates/Navigation.html.twig' ) : string Get the subnavigation html syntax: {{ getsubnavigation($type, $parentId, $startdepth, $enddepth, $excludeIds-splitted-by-dash, $template) }}
getURL ( integer $pageId, string $language = null ) : string Get the URL for a given pageId & language syntax: {{ geturl($pageId, $language) }}
getURLForBlock ( string $module, string $action = null, string $language = null, array $data = null ) : string Get the URL for a give module & action combination syntax: {{ geturlforblock($module, $action, $language, $data) }}
getURLForExtraId ( integer $extraId, string $language = null ) : string Fetch an URL based on an extraId syntax: {{ geturlforextraid($extraId, $language) }}
parseWidget ( string $module, string $action, string $id = null ) : null | string Parse a widget straight from the template, rather than adding it through pages.
profileSetting ( string $string, string $name ) : string Output a profile setting syntax: {{ profilesetting($string, $name) }}
timeAgo ( string $string = null ) : string Formats a timestamp as a string that indicates the time ago syntax: {{ $string|timeago }}.
toLabel ( string $value ) : string Convert this string into a well formed label.
userSetting ( string $string = null, string $setting, integer $userId = null ) : string Get the value for a user-setting syntax {{ usersetting($setting, $userId) }}

Описание методов

cleanupPlainText() публичный статический Метод

Formats plain text as HTML, links will be detected, paragraphs will be inserted syntax: {{ $string|cleanupPlainText }}.
public static cleanupPlainText ( string $string ) : string
$string string The text to cleanup.
Результат string

count() публичный статический Метод

Returns the count of the count of the array.
public static count ( array $data ) : integer
$data array
Результат integer

formatDate() публичный статический Метод

Format a UNIX-timestamp as a date syntax: {{ $var|formatdate }}
public static formatDate ( integer $var ) : string
$var integer The UNIX-timestamp to format or \DateTime
Результат string

formatDateTime() публичный статический Метод

Format a UNIX-timestamp as a date syntax: {{ $var|formatdatetime }}
public static formatDateTime ( integer $var ) : string
$var integer The UNIX-timestamp to format or \DateTime
Результат string

formatFloat() публичный статический Метод

Format a number as a float syntax: {{ $number|formatfloat($decimals) }}
public static formatFloat ( float $number, integer $decimals = 2 ) : string
$number float The number to format.
$decimals integer The number of decimals.
Результат string

formatNumber() публичный статический Метод

Format a number syntax: {{ $string|formatnumber($decimals) }}
public static formatNumber ( float $string, integer $decimals = null ) : string
$string float The number to format.
$decimals integer The number of decimals
Результат string

formatTime() публичный статический Метод

Format a UNIX-timestamp as a date syntax: {{ $var|formatdate }}
public static formatTime ( integer $var ) : string
$var integer The UNIX-timestamp to format or \DateTime
Результат string

getNavigation() публичный статический Метод

Get the navigation html syntax: {{ getnavigation($type, $parentId, $depth, $excludeIds-splitted-by-dash, $template) }}
public static getNavigation ( string $type = 'page', integer $parentId, integer $depth = null, string $excludeIds = null, string $template = '/Core/Layout/Templates/Navigation.html.twig' ) : string
$type string The type of navigation, possible values are: page, footer.
$parentId integer The parent wherefore the navigation should be build.
$depth integer The maximum depth that has to be build.
$excludeIds string Which pageIds should be excluded (split them by -).
$template string The template that will be used.
Результат string

getPageInfo() публичный статический Метод

Get a given field for a page-record syntax: {{ $pageId|getpageinfo($field) }}
public static getPageInfo ( integer $pageId, string $field = 'title' ) : string
$pageId integer The id of the page to build the URL for.
$field string The field to get.
Результат string

getPath() публичный статический Метод

Fetch the path for an include (theme file if available, core file otherwise) syntax: {{ getpath($file) }}
public static getPath ( string $file ) : string
$file string The base path.
Результат string

getSubNavigation() публичный статический Метод

NOTE: When supplying more than 1 ID to exclude, the single quotes around the dash-separated list are mandatory.
public static getSubNavigation ( string $type = 'page', integer $pageId, integer $startDepth = 1, integer $endDepth = null, string $excludeIds = null, string $template = '/Core/Layout/Templates/Navigation.html.twig' ) : string
$type string The type of navigation, possible values are: page, footer.
$pageId integer The parent wherefore the navigation should be build.
$startDepth integer The depth to start from.
$endDepth integer The maximum depth that has to be build.
$excludeIds string Which pageIds should be excluded (split them by -).
$template string The template that will be used.
Результат string

getURL() публичный статический Метод

Get the URL for a given pageId & language syntax: {{ geturl($pageId, $language) }}
public static getURL ( integer $pageId, string $language = null ) : string
$pageId integer The id of the page to build the URL for.
$language string The language to use, if not provided we will use the loaded language.
Результат string

getURLForBlock() публичный статический Метод

Get the URL for a give module & action combination syntax: {{ geturlforblock($module, $action, $language, $data) }}
public static getURLForBlock ( string $module, string $action = null, string $language = null, array $data = null ) : string
$module string The module wherefore the URL should be build.
$action string A specific action wherefore the URL should be build, otherwise the default will be used.
$language string The language to use, if not provided we will use the loaded language.
$data array An array with keys and values that partially or fully match the data of the block. If it matches multiple versions of that block it will just return the first match.
Результат string

getURLForExtraId() публичный статический Метод

Fetch an URL based on an extraId syntax: {{ geturlforextraid($extraId, $language) }}
public static getURLForExtraId ( integer $extraId, string $language = null ) : string
$extraId integer The id of the extra.
$language string The language to use, if not provided we will use the loaded language.
Результат string

parseWidget() публичный статический Метод

syntax: {{ parsewidget($module, $action, $id) }}
public static parseWidget ( string $module, string $action, string $id = null ) : null | string
$module string The module whose module we want to execute.
$action string The action to execute.
$id string The widget id (saved in data-column).
Результат null | string

profileSetting() публичный статический Метод

Output a profile setting syntax: {{ profilesetting($string, $name) }}
public static profileSetting ( string $string, string $name ) : string
$string string The variable
$name string The name of the setting
Результат string

timeAgo() публичный статический Метод

Formats a timestamp as a string that indicates the time ago syntax: {{ $string|timeago }}.
public static timeAgo ( string $string = null ) : string
$string string A UNIX-timestamp that will be formatted as a time-ago-string.
Результат string

toLabel() публичный статический Метод

syntax: {{ var|tolabel }}.
public static toLabel ( string $value ) : string
$value string The value to convert to a label.
Результат string

userSetting() публичный статический Метод

Get the value for a user-setting syntax {{ usersetting($setting, $userId) }}
public static userSetting ( string $string = null, string $setting, integer $userId = null ) : string
$string string The string passed from the template.
$setting string The name of the setting you want.
$userId integer The userId, if not set by $string.
Результат string