Documentation

Documentation

Table of Contents

Packages

Lwt

Namespaces

Lwt

Functions

url()  : string
Generate a URL with the application base path prepended.
__()  : string
Translate a key using the i18n translator.
__e()  : string
Translate a key and HTML-escape the result for safe output in templates.
base_path()  : string
Get the configured application base path.

Functions

url()

Generate a URL with the application base path prepended.

url([string $path = '/' ]) : string

Use this for all internal links to ensure they work correctly when the application is installed in a subdirectory.

Parameters
$path : string = '/'

The path to generate URL for (should start with /)

Tags
example

url('/login') returns '/lwt/login' if APP_BASE_PATH=/lwt

example

url('/') returns '/lwt' if APP_BASE_PATH=/lwt

example

url('/assets/css/main.css') returns '/lwt/assets/css/main.css'

Return values
string

The full URL path with base path prepended

__()

Translate a key using the i18n translator.

__(string $key[, array<string, string|int> $params = [] ]) : string
Parameters
$key : string

Dot-notated translation key (e.g. "common.save")

$params : array<string, string|int> = []

Interpolation parameters

Return values
string

Translated string, or the raw key if translator is unavailable

__e()

Translate a key and HTML-escape the result for safe output in templates.

__e(string $key[, array<string, string|int> $params = [] ]) : string
Parameters
$key : string

Dot-notated translation key

$params : array<string, string|int> = []

Interpolation parameters

Return values
string

HTML-escaped translated string

base_path()

Get the configured application base path.

base_path() : string
Return values
string

The base path (e.g., '/lwt') or empty string for root

Search results