PHP 클래스 Frontend\Core\Engine\TemplateModifiers

상속: extends Common\Core\Twig\Extensions\BaseTwigModifiers
파일 보기 프로젝트 열기: forkcms/forkcms 1 사용 예제들

공개 메소드들

메소드 설명
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