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

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

{@inheritdoc}

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

{@inheritdoc}

Template
loadTemplate(string $cls, 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 93
array get_phpbb_extensions()

Get the list of enabled phpBB extensions

Used in EVENT node

Return Value

array

at line 103
config get_phpbb_config()

Get phpBB config

Return Value

config

at line 113
string get_phpbb_root_path()

Get the phpBB root path

Return Value

string

at line 123
filesystem get_filesystem()

Get the filesystem object

Return Value

filesystem

at line 133
string get_web_root_path()

Get the web root path

Return Value

string

at line 143
path_helper get_path_helper()

Get the phpbb path helper object

Return Value

path_helper

at line 153
assets_bag get_assets_bag()

Gets the assets bag

Return Value

assets_bag

at line 163
array getNamespaceLookUpOrder()

Get the namespace look up order

Return Value

array

at line 174
Environment setNamespaceLookUpOrder(array $namespace)

Set the namespace look up order to load templates from

Parameters

array $namespace

Return Value

Environment

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

{@inheritdoc}

Parameters

$name
array $context

Return Value

string

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

{@inheritdoc}

Parameters

$name
array $context

Return Value

void

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

Loads a template by name.

Parameters

string $cls

The template class associated with the given template name

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 304
string findTemplate(string $name)

Finds a template by name.

Parameters

string $name

The template name

Return Value

string

Exceptions

LoaderError