PHP Class Bolt\Twig\TwigExtension

Inheritance: extends Twig_Extension, implements Twig_Extension_GlobalsInterface
Show file Open project: bolt/bolt Class Usage Examples

Public Methods

Method Description
__construct ( Silex\Application $app, Pimple $handlers, boolean $safe )
addData ( $path, $value )
buid ( )
canonical ( )
countWidgets ( $location = null, $zone = 'frontend' )
current ( $content )
decorateTT ( $str )
editable ( $html, $content, $field )
excerpt ( $content, $length = 200, $focus = null )
fields ( Twig_Environment $env, $record = null, $common = true, $extended = false, $repeaters = true, $templatefields = true, $template = '_sub_fields.twig', $exclude = null, $skip_uses = true )
fileExists ( $fn )
getFilters ( )
getFunctions ( )
getGlobals ( )
getName ( )
getTests ( )
getTokenParsers ( )
getUser ( $who )
getUserId ( $who )
getWidgets ( )
hasWidgets ( $location = null, $zone = 'frontend' )
hattr ( $attributes )
hclass ( $classes )
htmlLang ( )
image ( $filename = null, $width = null, $height = null, $crop = null )
imageInfo ( $filename )
isAllowed ( $what, $content = null )
isMobileClient ( )
jsonDecode ( $string )
link ( $location, $label = '[link]' )
listTemplates ( $filter = '' )
localeDateTime ( $dateTime, $format = '%B %e, %Y %H:%M' )
logLevel ( $level )
markdown ( $content )
menu ( Twig_Environment $env, $identifier = '', $template = '_sub_menu.twig', $params = [] )
order ( $array, $on, $onSecondary = '' )
pager ( Twig_Environment $env, $pagerName = '', $surr = 4, $template = '_sub_pager.twig', $class = '' )
popup ( $filename = null, $width = null, $height = null, $crop = null, $title = null )
pregReplace ( $str, $pattern, $replacement = '', $limit )
printBacktrace ( $depth = 15 )
printFirebug ( $var, $msg = '' )
randomQuote ( )
redirect ( $path )
request ( $parameter, $from = '', $stripslashes = false )
safeString ( $str, $strict = false, $extrachars = '' )
selectField ( $content, $fieldname, $startempty = false, $keyname = 'id' )
showImage ( $filename = null, $width = null, $height = null, $crop = null )
shuffle ( $array )
shy ( $str )
slug ( $str )
stack ( $types = [] )
testJson ( $string )
testStackable ( $filename )
thumbnail ( $filename = null, $width = null, $height = null, $crop = null )
token ( )
trans ( )
twig ( $snippet, $extravars = [] )
unique ( $array1, $array2 )
widgets ( $location = null, $zone = 'frontend', $wrapper = 'widgetwrapper.twig' )
ymllink ( $str )

Method Details

__construct() public method

public __construct ( Silex\Application $app, Pimple $handlers, boolean $safe )
$app Silex\Application
$handlers Pimple
$safe boolean

addData() public method

See also: Bolt\Twig\Handler\AdminHandler::addData()
public addData ( $path, $value )

buid() public method

See also: Bolt\Twig\Handler\AdminHandler::buid()
public buid ( )

canonical() public method

See also: Bolt\Twig\Handler\RoutingHandler::canonical()
public canonical ( )

countWidgets() public method

See also: Bolt\Twig\Handler\WidgetHandler::countWidgets()
public countWidgets ( $location = null, $zone = 'frontend' )

current() public method

See also: Bolt\Twig\Handler\RecordHandler::current()
public current ( $content )

decorateTT() public method

See also: Bolt\Twig\Handler\HtmlHandler::decorateTT()
public decorateTT ( $str )

editable() public method

See also: Bolt\Twig\Handler\HtmlHandler::editable()
public editable ( $html, $content, $field )

excerpt() public method

See also: Bolt\Twig\Handler\RecordHandler::excerpt()
public excerpt ( $content, $length = 200, $focus = null )

fields() public method

See also: Bolt\Twig\Handler\RecordHandler::fields()
public fields ( Twig_Environment $env, $record = null, $common = true, $extended = false, $repeaters = true, $templatefields = true, $template = '_sub_fields.twig', $exclude = null, $skip_uses = true )
$env Twig_Environment

fileExists() public method

See also: Bolt\Twig\Handler\UtilsHandler::fileExists()
public fileExists ( $fn )

getFilters() public method

public getFilters ( )

getFunctions() public method

public getFunctions ( )

getGlobals() public method

As of Twig 2.x, the ability to register a global variable after runtime or the extensions have been initialized will not be possible any longer, but changing the value of an already registered global is possible.
public getGlobals ( )

getName() public method

public getName ( )

getTests() public method

public getTests ( )

getTokenParsers() public method

public getTokenParsers ( )

getUser() public method

See also: Bolt\Twig\Handler\UserHandler::getUser()
public getUser ( $who )

getUserId() public method

See also: Bolt\Twig\Handler\UserHandler::getUserId()
public getUserId ( $who )

getWidgets() public method

See also: Bolt\Twig\Handler\WidgetHandler::getWidgets()
public getWidgets ( )

hasWidgets() public method

See also: Bolt\Twig\Handler\WidgetHandler::hasWidgets()
public hasWidgets ( $location = null, $zone = 'frontend' )

hattr() public method

See also: Bolt\Twig\Handler\AdminHandler::hattr()
public hattr ( $attributes )

hclass() public method

See also: Bolt\Twig\Handler\AdminHandler::hclass()
public hclass ( $classes )

htmlLang() public method

See also: Bolt\Twig\Handler\HtmlHandler::htmlLang()
public htmlLang ( )

image() public method

See also: Bolt\Twig\Handler\ImageHandler::image()
public image ( $filename = null, $width = null, $height = null, $crop = null )

imageInfo() public method

See also: Bolt\Twig\Handler\ImageHandler::imageInfo()
public imageInfo ( $filename )

isAllowed() public method

See also: Bolt\Twig\Handler\UserHandler::isAllowed()
public isAllowed ( $what, $content = null )

isMobileClient() public method

See also: Bolt\Twig\Handler\HtmlHandler::isMobileClient()
public isMobileClient ( )

jsonDecode() public method

See also: Bolt\Twig\Handler\TextHandler::jsonDecode()
public jsonDecode ( $string )

listTemplates() public method

See also: Bolt\Twig\Handler\RecordHandler::listTemplates()
public listTemplates ( $filter = '' )

localeDateTime() public method

See also: Bolt\Twig\Handler\TextHandler::localeDateTime()
public localeDateTime ( $dateTime, $format = '%B %e, %Y %H:%M' )

logLevel() public method

See also: Bolt\Twig\Handler\AdminHandler::logLevel()
public logLevel ( $level )

markdown() public method

See also: Bolt\Twig\Handler\HtmlHandler::markdown()
public markdown ( $content )

menu() public method

See also: Bolt\Twig\Handler\HtmlHandler::menu()
public menu ( Twig_Environment $env, $identifier = '', $template = '_sub_menu.twig', $params = [] )
$env Twig_Environment

order() public method

See also: Bolt\Twig\Handler\ArrayHandler::order()
public order ( $array, $on, $onSecondary = '' )

pager() public method

See also: Bolt\Twig\Handler\RecordHandler::pager()
public pager ( Twig_Environment $env, $pagerName = '', $surr = 4, $template = '_sub_pager.twig', $class = '' )
$env Twig_Environment

popup() public method

See also: Bolt\Twig\Handler\ImageHandler::popup()
public popup ( $filename = null, $width = null, $height = null, $crop = null, $title = null )

pregReplace() public method

See also: Bolt\Twig\Handler\TextHandler::pregReplace()
public pregReplace ( $str, $pattern, $replacement = '', $limit )

printBacktrace() public method

See also: Bolt\Twig\Handler\UtilsHandler::printBacktrace()
public printBacktrace ( $depth = 15 )

printFirebug() public method

See also: Bolt\Twig\Handler\UtilsHandler::printFirebug()
public printFirebug ( $var, $msg = '' )

randomQuote() public method

See also: Bolt\Twig\Handler\AdminHandler::randomQuote()
public randomQuote ( )

redirect() public method

See also: Bolt\Twig\Handler\UtilsHandler::redirect()
public redirect ( $path )

request() public method

See also: Bolt\Twig\Handler\UtilsHandler::request()
public request ( $parameter, $from = '', $stripslashes = false )

safeString() public method

See also: Bolt\Twig\Handler\TextHandler::safeString()
public safeString ( $str, $strict = false, $extrachars = '' )

selectField() public method

See also: Bolt\Twig\Handler\RecordHandler::selectField()
public selectField ( $content, $fieldname, $startempty = false, $keyname = 'id' )

showImage() public method

See also: Bolt\Twig\Handler\ImageHandler::showImage()
public showImage ( $filename = null, $width = null, $height = null, $crop = null )

shuffle() public method

See also: Bolt\Twig\Handler\ArrayHandler::shuffle()
public shuffle ( $array )

shy() public method

See also: Bolt\Twig\Handler\HtmlHandler::shy()
public shy ( $str )

slug() public method

See also: Bolt\Twig\Handler\TextHandler::slug()
public slug ( $str )

stack() public method

See also: Bolt\Twig\Handler\AdminHandler::stackItems()
public stack ( $types = [] )

testJson() public method

See also: Bolt\Twig\Handler\TextHandler::testJson()
public testJson ( $string )

testStackable() public method

See also: Bolt\Twig\Handler\AdminHandler::testStackable()
public testStackable ( $filename )

thumbnail() public method

See also: Bolt\Twig\Handler\ImageHandler::thumbnail()
public thumbnail ( $filename = null, $width = null, $height = null, $crop = null )

token() public method

See also: Bolt\Twig\Handler\UserHandler::token()
public token ( )

trans() public method

See also: Bolt\Twig\Handler\AdminHandler::trans()
public trans ( )

twig() public method

See also: Bolt\Twig\Handler\HtmlHandler::twig()
public twig ( $snippet, $extravars = [] )

unique() public method

See also: Bolt\Twig\Handler\ArrayHandler::unique()
public unique ( $array1, $array2 )

widgets() public method

See also: Bolt\Twig\Handler\WidgetHandler::widgets()
public widgets ( $location = null, $zone = 'frontend', $wrapper = 'widgetwrapper.twig' )