class helper

Controller helper class, contains methods that do things for controllers

Properties

protected auth $auth
protected driver_interface $cache
protected config $config
protected manager $cron_manager
protected driver_interface $db
protected dispatcher $dispatcher
protected language $language
protected $request
protected helper $routing_helper
protected $symfony_request
protected template $template
protected user $user
protected string $admin_path
protected string $php_ext
protected bool $sql_explain

Methods

__construct(auth $auth, driver_interface $cache, config $config, manager $cron_manager, driver_interface $db, dispatcher $dispatcher, language $language, request_interface $request, helper $routing_helper, symfony_request $symfony_request, template $template, user $user, string $root_path, string $admin_path, string $php_ext, bool $sql_explain = false)

Constructor

Response
render(string $template_file, string $page_title = '', int $status_code = 200, bool $display_online_list = false, int $item_id = 0, string $item = 'forum', bool $send_headers = false)

Automate setting up the page and creating the response object.

string
route(string $route, array $params = array(), bool $is_amp = true, string|bool $session_id = false, int $reference_type = UrlGeneratorInterface::ABSOLUTE_PATH)

Generate a URL to a route

Response
error(string $message, int $code = 500) deprecated

Output an error, effectively the same thing as trigger_error

Response
message(string $message, array $parameters = array(), string $title = 'INFORMATION', int $code = 200)

Output a message

void
assign_meta_refresh_var(int $time, string $url)

Assigns automatic refresh time meta tag in template

string
get_current_url()

Return the current url

void
display_footer(bool $run_cron = true)

Handle display actions for footer, e.g. SQL report and credit line

void
display_sql_report()

Display SQL report

void
set_cron_task()

Set cron task for footer

Details

at line 102
__construct(auth $auth, driver_interface $cache, config $config, manager $cron_manager, driver_interface $db, dispatcher $dispatcher, language $language, request_interface $request, helper $routing_helper, symfony_request $symfony_request, template $template, user $user, string $root_path, string $admin_path, string $php_ext, bool $sql_explain = false)

Constructor

Parameters

auth $auth

Auth object

driver_interface $cache
config $config

Config object

manager $cron_manager
driver_interface $db

DBAL object

dispatcher $dispatcher
language $language
request_interface $request

phpBB request object

helper $routing_helper

Helper to generate the routes

symfony_request $symfony_request

Symfony Request object

template $template

Template object

user $user

User object

string $root_path

phpBB root path

string $admin_path

Admin path

string $php_ext

PHP extension

bool $sql_explain

Flag whether to display sql explain

at line 138
Response render(string $template_file, string $page_title = '', int $status_code = 200, bool $display_online_list = false, int $item_id = 0, string $item = 'forum', bool $send_headers = false)

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

int $status_code

The status code to be sent to the page header

bool $display_online_list

Do we display online users list

int $item_id

Restrict online users to item id

string $item

Restrict online users to a certain session item, e.g. forum for session_forum_id

bool $send_headers

Whether headers should be sent by page_header(). Defaults to false for controllers.

Return Value

Response

object containing rendered page

at line 210
string route(string $route, array $params = array(), bool $is_amp = true, string|bool $session_id = false, int $reference_type = UrlGeneratorInterface::ABSOLUTE_PATH)

Generate a URL to a route

Parameters

string $route

Name of the route to travel

array $params

String or array of additional url parameters

bool $is_amp

Is url using & (true) or & (false)

string|bool $session_id

Possibility to use a custom session id instead of the global one

int $reference_type

The type of reference to be generated (one of the constants)

Return Value

string

The URL already passed through append_sid()

at line 224
Response error(string $message, int $code = 500) deprecated

deprecated 3.1.3 (To be removed: 4.0.0) Use exceptions instead.

Output an error, effectively the same thing as trigger_error

Parameters

string $message

The error message

int $code

The error code (e.g. 404, 500, 503, etc.)

Return Value

Response

A Response instance

at line 240
Response message(string $message, array $parameters = array(), string $title = 'INFORMATION', int $code = 200)

Output a message

In case of an error, please throw an exception instead

Parameters

string $message

The message to display (must be a language variable)

array $parameters

The parameters to use with the language var

string $title

Title for the message (must be a language variable)

int $code

The HTTP status code (e.g. 404, 500, 503, etc.)

Return Value

Response

A Response instance

at line 277
void assign_meta_refresh_var(int $time, string $url)

Assigns automatic refresh time meta tag in template

Parameters

int $time

time in seconds, when redirection should occur

string $url

the URL where the user should be redirected

Return Value

void

at line 289
string get_current_url()

Return the current url

Return Value

string

Handle display actions for footer, e.g. SQL report and credit line

Parameters

bool $run_cron

Flag whether cron should be run

Return Value

void

at line 324
void display_sql_report()

Display SQL report

Return Value

void

at line 337
protected void set_cron_task()

Set cron task for footer

Return Value

void