class helper

A duplicate of \phpbb\controller\helper

This class is necessary because of controller\helper's legacy function calls to page_header() page_footer() functions which has unavailable dependencies.

Properties

protected config $installer_config
protected language $language
$language_cookie
protected language_file_helper $lang_helper
protected navigation_provider $navigation_provider
protected template $template
protected path_helper $path_helper
protected request $phpbb_request
protected symfony_request $request
protected router $router
protected string $phpbb_admin_path
protected string $phpbb_root_path

Methods

__construct(config $config, language $language, language_file_helper $lang_helper, navigation_provider $nav, template $template, path_helper $path_helper, request $phpbb_request, symfony_request $request, router $router, string $phpbb_root_path)

Constructor

Response
render(string $template_file, string $page_title = '', bool $selected_language = false, int $status_code = 200)

Automate setting up the page and creating the response object.

string
route(string $route_name, array $parameters = array())

Returns path from route name

handle_language_select()

Handles language selector form

handle_navigation(iohandler_interface|null $iohandler = null)

Process navigation data to reflect active/completed stages

page_header(string $page_title, bool $selected_language = false)

Set default template variables

render_navigation()

Render navigation

render_language_select(string $selected_language = null)

Render language select form

string|bool
get_active_main_menu(array $nav_array)

Returns the name of the active main menu item

array
sort_navigation_level(array $nav_array)

Sorts the top level of navigation array

Details

at line 111
__construct(config $config, language $language, language_file_helper $lang_helper, navigation_provider $nav, template $template, path_helper $path_helper, request $phpbb_request, symfony_request $request, router $router, string $phpbb_root_path)

Constructor

Parameters

config $config
language $language
language_file_helper $lang_helper
navigation_provider $nav
template $template
path_helper $path_helper
request $phpbb_request
symfony_request $request
router $router
string $phpbb_root_path

at line 137
Response render(string $template_file, string $page_title = '', bool $selected_language = false, int $status_code = 200)

Automate setting up the page and creating the response object.

Parameters

string $template_file

The template handle to render

string $page_title

The title of the page to output

bool $selected_language

True to enable language selector it, false otherwise

int $status_code

The status code to be sent to the page header

Return Value

Response

object containing rendered page

at line 167
string route(string $route_name, array $parameters = array())

Returns path from route name

Parameters

string $route_name
array $parameters

Return Value

string

at line 177
handle_language_select()

Handles language selector form

at line 212
handle_navigation(iohandler_interface|null $iohandler = null)

Process navigation data to reflect active/completed stages

Parameters

iohandler_interface|null $iohandler

at line 254
protected page_header(string $page_title, bool $selected_language = false)

Set default template variables

Parameters

string $page_title

Title of the page

bool $selected_language

True to enable language selector it, false otherwise

at line 289
protected render_navigation()

Render navigation

at line 339
protected render_language_select(string $selected_language = null)

Render language select form

Parameters

string $selected_language

at line 359
protected string|bool get_active_main_menu(array $nav_array)

Returns the name of the active main menu item

Parameters

array $nav_array

Return Value

string|bool

Returns the name of the active main menu element, if the element not found, returns false

at line 394
protected array sort_navigation_level(array $nav_array)

Sorts the top level of navigation array

Parameters

array $nav_array

Navigation array

Return Value

array