Documentation

Core_Templater extends Core_Meta
in package

Core_Templater

Tags
subpackage

Core

version
7.x
author

Hostmake LLC

copyright

© 2005-2022 ООО "Хостмэйк" (Hostmake LLC), http://www.hostcms.ru

Table of Contents

$_functions  : array<string|int, mixed>
Array of functions [name] => callable
$_objects  : array<string|int, mixed>
Array of objects [name] => $object
$_replaceFunctions  : array<string|int, mixed>
Predefined functions
$_template  : string
Template string
__construct()  : mixed
Constructor.
addFunction()  : self
Add function
addObject()  : self
Add object
apply()  : string
Apply template, e.g. {group.name}, {toLower group.name}, {toLower group.groupPathWithSeparator " / " 1}
clear()  : self
Clear meta
day()  : string
Get current day
decorateInput()  : self
Decorate template number input
execute()  : mixed
getTemplate()  : string
Get template number string
month()  : string
Get current month
setTemplate()  : self
Set template number string
year()  : string
Get current year
_callback()  : string
Replace callback function
_parseArgs()  : array<string|int, mixed>
Parse args

Properties

$_functions

Array of functions [name] => callable

protected array<string|int, mixed> $_functions = array()

$_objects

Array of objects [name] => $object

protected array<string|int, mixed> $_objects = array()

$_replaceFunctions

Predefined functions

protected array<string|int, mixed> $_replaceFunctions = array('toUpper' => 'mb_strtoupper', 'toLower' => 'mb_strtolower', 'uppercaseFirst' => 'Core_Str::ucfirst', 'lowercaseFirst' => 'Core_Str::lcfirst')

$_template

Template string

protected string $_template = \NULL

Methods

__construct()

Constructor.

public __construct() : mixed
Return values
mixed

addFunction()

Add function

public addFunction(string $name, callable $callable) : self
Parameters
$name : string
$callable : callable
Return values
self

addObject()

Add object

public addObject(string $name, string $object) : self
Parameters
$name : string
$object : string
Return values
self

apply()

Apply template, e.g. {group.name}, {toLower group.name}, {toLower group.groupPathWithSeparator " / " 1}

public apply(string $str) : string
Parameters
$str : string
Return values
string

clear()

Clear meta

public clear() : self
Return values
self

day()

Get current day

public static day() : string
Return values
string

decorateInput()

Decorate template number input

public static decorateInput(object $oInput[, array<string|int, mixed> $aOptions = array() ]) : self
Parameters
$oInput : object
$aOptions : array<string|int, mixed> = array()
Return values
self

execute()

public execute() : mixed
Return values
mixed

getTemplate()

Get template number string

public getTemplate() : string
Return values
string

month()

Get current month

public static month() : string
Return values
string

setTemplate()

Set template number string

public setTemplate(string $string) : self
Parameters
$string : string
Return values
self

year()

Get current year

public static year() : string
Return values
string

_callback()

Replace callback function

protected _callback(array<string|int, mixed> $matches) : string
Parameters
$matches : array<string|int, mixed>
Return values
string

_parseArgs()

Parse args

protected _parseArgs(string $str) : array<string|int, mixed>
Parameters
$str : string
Return values
array<string|int, mixed>

Search results