PEEL Shopping
Open source ecommerce : PEEL Shopping
Public Member Functions | Protected Member Functions | Protected Attributes
Twig_Error Class Reference

Twig base exception. More...

Inheritance diagram for Twig_Error:
Twig_Error_Loader Twig_Error_Runtime Twig_Error_Syntax Twig_Sandbox_SecurityError

Public Member Functions

 __construct ($message, $lineno=-1, $filename=null, Exception $previous=null)
 Constructor. More...
 
 getRawMessage ()
 Gets the raw message. More...
 
 getTemplateFile ()
 Gets the filename where the error occurred. More...
 
 setTemplateFile ($filename)
 Sets the filename where the error occurred. More...
 
 getTemplateLine ()
 Gets the template line where the error occurred. More...
 
 setTemplateLine ($lineno)
 Sets the template line where the error occurred. More...
 
 guess ()
 
 __call ($method, $arguments)
 For PHP < 5.3.0, provides access to the getPrevious() method. More...
 

Protected Member Functions

 updateRepr ()
 
 guessTemplateInfo ()
 

Protected Attributes

 $lineno
 
 $filename
 
 $rawMessage
 
 $previous
 

Detailed Description

Twig base exception.

This exception class and its children must only be used when an error occurs during the loading of a template, when a syntax error is detected in a template, or when rendering a template. Other errors must use regular PHP exception classes (like when the template cache directory is not writable for instance).

To help debugging template issues, this class tracks the original template name and line where the error occurred.

Whenever possible, you must set these information (original template name and line number) yourself by passing them to the constructor. If some or all these information are not available from where you throw the exception, then this class will guess them automatically (when the line number is set to -1 and/or the filename is set to null). As this is a costly operation, this can be disabled by passing false for both the filename and the line number when creating a new instance of this class.

Author
Fabien Potencier fabie.nosp@m.n@sy.nosp@m.mfony.nosp@m..com

Definition at line 34 of file Error.php.

Constructor & Destructor Documentation

__construct (   $message,
  $lineno = -1,
  $filename = null,
Exception  $previous = null 
)

Constructor.

Set both the line number and the filename 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 filename to null to enable its automatic guessing.

By default, automatic guessing is enabled.

Parameters
string$messageThe error message
integer$linenoThe template line where the error occurred
string$filenameThe template file name where the error occurred
Exception$previousThe previous exception

Definition at line 58 of file Error.php.

Member Function Documentation

__call (   $method,
  $arguments 
)

For PHP < 5.3.0, provides access to the getPrevious() method.

Parameters
string$methodThe method name
array$argumentsThe parameters to be passed to the method
Returns
Exception The previous exception or null
Exceptions
BadMethodCallException

Definition at line 149 of file Error.php.

getRawMessage ( )

Gets the raw message.

Returns
string The raw message

Definition at line 84 of file Error.php.

getTemplateFile ( )

Gets the filename where the error occurred.

Returns
string The filename

Definition at line 94 of file Error.php.

getTemplateLine ( )

Gets the template line where the error occurred.

Returns
integer The template line

Definition at line 116 of file Error.php.

guess ( )

Definition at line 133 of file Error.php.

guessTemplateInfo ( )
protected

Definition at line 186 of file Error.php.

setTemplateFile (   $filename)

Sets the filename where the error occurred.

Parameters
string$filenameThe filename

Definition at line 104 of file Error.php.

setTemplateLine (   $lineno)

Sets the template line where the error occurred.

Parameters
integer$linenoThe template line

Definition at line 126 of file Error.php.

updateRepr ( )
protected

Definition at line 158 of file Error.php.

Field Documentation

$filename
protected

Definition at line 37 of file Error.php.

$lineno
protected

Definition at line 36 of file Error.php.

$previous
protected

Definition at line 39 of file Error.php.

$rawMessage
protected

Definition at line 38 of file Error.php.


The documentation for this class was generated from the following file:

This documentation for Open ecommerce PEEL Shopping and PEEL.fr has been generated by Doxygen on Thu Oct 15 2015 14:41:44 - Peel ecommerce is a product of Agence web Advisto SAS. All rights reserved.