class Twig_Error_Runtime extends Twig_Error

Exception thrown when an error occurs at runtime.

Methods

__construct(string $message, int $lineno = -1, Twig_Source|string|null $source = null, Exception $previous = null)

Constructor.

string
getRawMessage()

Gets the raw message.

int
getTemplateLine()

Gets the template line where the error occurred.

setTemplateLine(int $lineno)

Sets the template line where the error occurred.

getSourceContext()

Gets the source context of the Twig template where the error occurred.

setSourceContext(Twig_Source $source = null)

Sets the source context of the Twig template where the error occurred.

guess()

No description

appendMessage($rawMessage)

No description

Details

in Twig_Error at line 59
__construct(string $message, int $lineno = -1, Twig_Source|string|null $source = null, Exception $previous = null)

Constructor.

Set both the line number and the name to false to disable automatic guessing of the original template name and line number.

Set the line number to -1 to enable its automatic guessing. Set the name to null to enable its automatic guessing.

By default, automatic guessing is enabled.

Parameters

string $message The error message
int $lineno The template line where the error occurred
Twig_Source|string|null $source The source context where the error occurred
Exception $previous The previous exception

in Twig_Error at line 91
string getRawMessage()

Gets the raw message.

Return Value

string The raw message

in Twig_Error at line 101
int getTemplateLine()

Gets the template line where the error occurred.

Return Value

int The template line

in Twig_Error at line 111
setTemplateLine(int $lineno)

Sets the template line where the error occurred.

Parameters

int $lineno The template line

in Twig_Error at line 123
Twig_Source|null getSourceContext()

Gets the source context of the Twig template where the error occurred.

Return Value

Twig_Source|null

in Twig_Error at line 131
setSourceContext(Twig_Source $source = null)

Sets the source context of the Twig template where the error occurred.

Parameters

Twig_Source $source

in Twig_Error at line 144
guess()

in Twig_Error at line 150
appendMessage($rawMessage)

Parameters

$rawMessage