phpBB API Documentation
Class

phpbb\template\twig\environment

class environment extends Twig_Environment

Methods

__construct(config $phpbb_config, filesystem $filesystem, path_helper $path_helper, string $cache_path, manager $extension_manager = null, Twig_LoaderInterface $loader = null, dispatcher_interface $phpbb_dispatcher = null, array $options = array())

Constructor

array get_phpbb_extensions()

Get the list of enabled phpBB extensions

config get_phpbb_config()

Get phpBB config

string get_phpbb_root_path()

Get the phpBB root path

filesystem get_filesystem()

Get the filesystem object

string get_web_root_path()

Get the web root path

path_helper get_path_helper()

Get the phpbb path helper object

assets_bag get_assets_bag()

Gets the assets bag

array getNamespaceLookUpOrder()

Get the namespace look up order

Twig_Environment setNamespaceLookUpOrder(array $namespace)

Set the namespace look up order to load templates from

render($name, array $context = array())

{@inheritdoc}

display($name, array $context = array())

{@inheritdoc}

Twig_TemplateInterface loadTemplate(string $name, integer $index = null)

Loads a template by name.

string findTemplate(string $name)

Finds a template by name.

Details

at line 62
public __construct(config $phpbb_config, filesystem $filesystem, path_helper $path_helper, string $cache_path, manager $extension_manager = null, Twig_LoaderInterface $loader = null, dispatcher_interface $phpbb_dispatcher = null, array $options = array())

Constructor

Parameters

config $phpbb_config The phpBB configuration
filesystem $filesystem
path_helper $path_helper phpBB path helper
string $cache_path The path to the cache directory
manager $extension_manager phpBB extension manager
Twig_LoaderInterface $loader Twig loader interface
dispatcher_interface $phpbb_dispatcher Event dispatcher object
array $options Array of options to pass to Twig

at line 93
public array get_phpbb_extensions()

Get the list of enabled phpBB extensions

Used in EVENT node

Return Value

array

at line 103
public config get_phpbb_config()

Get phpBB config

Return Value

config

at line 113
public string get_phpbb_root_path()

Get the phpBB root path

Return Value

string

at line 123
public filesystem get_filesystem()

Get the filesystem object

Return Value

filesystem

at line 133
public string get_web_root_path()

Get the web root path

Return Value

string

at line 143
public path_helper get_path_helper()

Get the phpbb path helper object

Return Value

path_helper

at line 153
public assets_bag get_assets_bag()

Gets the assets bag

Return Value

assets_bag

at line 163
public array getNamespaceLookUpOrder()

Get the namespace look up order

Return Value

array

at line 174
public Twig_Environment setNamespaceLookUpOrder(array $namespace)

Set the namespace look up order to load templates from

Parameters

array $namespace

Return Value

Twig_Environment

at line 184
public render($name, array $context = array())

{@inheritdoc}

Parameters

$name
array $context

at line 192
public display($name, array $context = array())

{@inheritdoc}

Parameters

$name
array $context

at line 267
public Twig_TemplateInterface loadTemplate(string $name, integer $index = null)

Loads a template by name.

Parameters

string $name The template name
integer $index The index if it is an embedded template

Return Value

Twig_TemplateInterface A template instance representing the given template name

Exceptions

Twig_Error_Loader

at line 303
public string findTemplate(string $name)

Finds a template by name.

Parameters

string $name The template name

Return Value

string

Exceptions

Twig_Error_Loader