class environment extends Environment

Properties

protected config $phpbb_config
protected filesystem $filesystem
protected path_helper $phpbb_path_helper
protected ContainerInterface $container
protected manager $extension_manager
protected dispatcher_interface $phpbb_dispatcher
protected string $phpbb_root_path
protected string $web_root_path
protected array $namespace_look_up_order
protected assets_bag $assets_bag

Methods

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

Constructor

array
get_phpbb_extensions()

Get the list of enabled phpBB extensions

get_phpbb_config()

Get phpBB config

string
get_phpbb_root_path()

Get the phpBB root path

get_filesystem()

Get the filesystem object

string
get_web_root_path()

Get the web root path

get_path_helper()

Get the phpbb path helper object

get_assets_bag()

Gets the assets bag

array
getNamespaceLookUpOrder()

Get the namespace look up order

Environment
setNamespaceLookUpOrder(array $namespace)

Set the namespace look up order to load templates from

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

{@inheritdoc}

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

{@inheritdoc}

Template
loadTemplate(string $name, int $index = null)

Loads a template by name.

string
findTemplate(string $name)

Finds a template by name.

Details

at line 62
__construct(config $phpbb_config, filesystem $filesystem, path_helper $path_helper, string $cache_path, manager $extension_manager = null, 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

LoaderInterface $loader

Twig loader interface

dispatcher_interface $phpbb_dispatcher

Event dispatcher object

array $options

Array of options to pass to Twig

at line 92
array get_phpbb_extensions()

Get the list of enabled phpBB extensions

Used in EVENT node

Return Value

array

at line 102
config get_phpbb_config()

Get phpBB config

Return Value

config

at line 112
string get_phpbb_root_path()

Get the phpBB root path

Return Value

string

at line 122
filesystem get_filesystem()

Get the filesystem object

Return Value

filesystem

at line 132
string get_web_root_path()

Get the web root path

Return Value

string

at line 142
path_helper get_path_helper()

Get the phpbb path helper object

Return Value

path_helper

at line 152
assets_bag get_assets_bag()

Gets the assets bag

Return Value

assets_bag

at line 162
array getNamespaceLookUpOrder()

Get the namespace look up order

Return Value

array

at line 173
Environment setNamespaceLookUpOrder(array $namespace)

Set the namespace look up order to load templates from

Parameters

array $namespace

Return Value

Environment

at line 183
render($name, array $context = [])

{@inheritdoc}

Parameters

$name
array $context

at line 191
display($name, array $context = [])

{@inheritdoc}

Parameters

$name
array $context

at line 266
Template loadTemplate(string $name, int $index = null)

Loads a template by name.

Parameters

string $name

The template name

int $index

The index if it is an embedded template

Return Value

Template

A template instance representing the given template name

Exceptions

LoaderError

at line 302
string findTemplate(string $name)

Finds a template by name.

Parameters

string $name

The template name

Return Value

string

Exceptions

LoaderError