class DefaultHook extends BaseHook

Class DefaultHook

Constants

INJECT_TEMPLATE_METHOD_NAME

Properties

BaseModule $module from  BaseHook
ParserInterface $parser from  BaseHook
TranslatorInterface $translator from  BaseHook
AssetResolverInterface $assetsResolver from  BaseHook
EventDispatcherInterface $dispatcher from  BaseHook

Methods

insertTemplate( HookRenderEvent $event, string $code)

This function is called when hook uses the automatic insert template.

from  BaseHook
string
render( string $templateName, array $parameters = array())

helper function allowing you to render a template using a template engine

from  BaseHook
string
dump( string $fileName)

helper function allowing you to get the content of a file

from  BaseHook
string
addCSS( string $fileName, array $attributes = array(), array $filters = array())

helper function allowing you to generate the HTML link tag

from  BaseHook
string
addJS( string $fileName, array $attributes = array(), array $filters = array())

helper function allowing you to generate the HTML script tag

from  BaseHook
setModule( BaseModule $module)

No description

from  BaseHook
getModule()

No description

from  BaseHook
setParser( ParserInterface $parser)

No description

from  BaseHook
getParser()

No description

from  BaseHook
addTemplate( string $hookCode, string $value)

Add a new template for automatic render

from  BaseHook
array
getTemplates()

No description

from  BaseHook

Details

in BaseHook at line 91
insertTemplate( HookRenderEvent $event, string $code)

This function is called when hook uses the automatic insert template.

Parameters

HookRenderEvent $event
string $code

in BaseHook at line 134
string render( string $templateName, array $parameters = array())

helper function allowing you to render a template using a template engine

Parameters

string $templateName the template path of the template
array $parameters an array of parameters to assign to a template engine

Return Value

string the content generated by a template engine

in BaseHook at line 155
string dump( string $fileName)

helper function allowing you to get the content of a file

Parameters

string $fileName the template path of the template

Return Value

string the content of the file

in BaseHook at line 180
string addCSS( string $fileName, array $attributes = array(), array $filters = array())

helper function allowing you to generate the HTML link tag

Parameters

string $fileName the path to the css file
array $attributes the attributes of the tag
array $filters an array of assets processing filters (less, sass, etc.)

Return Value

string the link tag

in BaseHook at line 211
string addJS( string $fileName, array $attributes = array(), array $filters = array())

helper function allowing you to generate the HTML script tag

Parameters

string $fileName the path to the js file
array $attributes the attributes of the tag
array $filters an array of assets processing filters (cofeescript, compress, etc.)

Return Value

string the script tag

in BaseHook at line 236
setModule( BaseModule $module)

Parameters

BaseModule $module

in BaseHook at line 244
BaseModule getModule()

Return Value

BaseModule

in BaseHook at line 252
setParser( ParserInterface $parser)

Parameters

ParserInterface $parser

in BaseHook at line 260
ParserInterface getParser()

Return Value

ParserInterface

in BaseHook at line 406
addTemplate( string $hookCode, string $value)

Add a new template for automatic render

Parameters

string $hookCode the code of the hook (the name of the event used to render) : 'hook.{type}.{hook code}'
string $value list of the template to render or add. eg: 'render:mytemplate.html;css:assets/css/mycss.css;js:assets/js/myjs.js'

in BaseHook at line 418
array getTemplates()

Return Value

array templates