class MomentTwigExtension extends TwigExtension

Class MomentTwigExtension.

Methods

__construct()

No description

$this
setOptions( TwigOptionsDefinition $options)

No description

$this
addOptionNeedsEnvironment( bool $enable = true)

Sets the options that tells Twig it should inject the Twig_Enviornment into the function call.

$this
addOptionHtmlSafe( bool $enable = true)

Sets the option that allows for HTML to be returned from the extension function.

string
getName()

Returns the name of the Twig extension based on the classname.

$this
clearFunctions()

Clears the array of extension functions.

Twig_Function[]
getFunctions()

Returns an array of extension functions as {@see:\Twig_Function}.

$this
addFunctions( array $functions = array())

Adds an array of extension functions.

$this
addFunction( string $name, callable $callable, TwigOptionsDefinition $options = null)

Add functions to extension.

$this
clearFilters()

Clears the array of extension filters.

Twig_Filter[]
getFilters()

Returns an array of extension filters as {@see:\Twig_Filters}.

$this
addFilters( array $filters = array())

Adds an array of extension filters.

$this
addFilter( string $name, callable $callable, TwigOptionsDefinition $options = null)

Add filter to extension.

string
moment( DateTime $ago)

No description

Details

at line line 19
__construct()

in TwigExtension at line line 55
TwigOptionsDefinition getOptions()

Return Value

TwigOptionsDefinition

in TwigExtension at line line 65
$this setOptions( TwigOptionsDefinition $options)

Parameters

TwigOptionsDefinition $options

Return Value

$this

in TwigExtension at line line 79
$this addOptionNeedsEnvironment( bool $enable = true)

Sets the options that tells Twig it should inject the Twig_Enviornment into the function call.

Parameters

bool $enable

Return Value

$this

in TwigExtension at line line 93
$this addOptionHtmlSafe( bool $enable = true)

Sets the option that allows for HTML to be returned from the extension function.

Parameters

bool $enable

Return Value

$this

in TwigExtension at line line 105
final string getName()

Returns the name of the Twig extension based on the classname.

Return Value

string

in TwigExtension at line line 115
final $this clearFunctions()

Clears the array of extension functions.

Return Value

$this

in TwigExtension at line line 127
final Twig_Function[] getFunctions()

Returns an array of extension functions as {@see:\Twig_Function}.

Return Value

Twig_Function[]

in TwigExtension at line line 139
final $this addFunctions( array $functions = array())

Adds an array of extension functions.

Parameters

array $functions

Return Value

$this

in TwigExtension at line line 163
final $this addFunction( string $name, callable $callable, TwigOptionsDefinition $options = null)

Add functions to extension.

Parameters

string $name
callable $callable
TwigOptionsDefinition $options

Return Value

$this

in TwigExtension at line line 175
final $this clearFilters()

Clears the array of extension filters.

Return Value

$this

in TwigExtension at line line 187
final Twig_Filter[] getFilters()

Returns an array of extension filters as {@see:\Twig_Filters}.

Return Value

Twig_Filter[]

in TwigExtension at line line 199
final $this addFilters( array $filters = array())

Adds an array of extension filters.

Parameters

array $filters

Return Value

$this

in TwigExtension at line line 221
final $this addFilter( string $name, callable $callable, TwigOptionsDefinition $options = null)

Add filter to extension.

Parameters

string $name
callable $callable
TwigOptionsDefinition $options

Return Value

$this

at line line 32
string moment( DateTime $ago)

Parameters

DateTime $ago

Return Value

string