PHP Class Jade\Jade

Inheritance: extends Jade\Engine\Keywords
Afficher le fichier Open project: kylekatarnls/jade-php Class Usage Examples

Protected Properties

Свойство Type Description
$filters array Built-in filters.
$sharedVariables array
$streamName string

Méthodes publiques

Méthode Description
__construct ( array $options = [] ) Merge local options with constructor $options.
compile ( string $input, string $filename = null ) : string Compile PHP code from a Pug input or a Pug file.
render ( $input, $filename = null, array $vars = [] ) : string Compile HTML code from a Pug input or a Pug file.
requirements ( $name = null ) : array | boolean Returns list of requirements in an array identified by keys.
resetSharedVariables ( ) Remove all previously set shared variables.
share ( $variables, mixed $value = null ) Add a variable or an array of variables to be shared with all templates that will be rendered by the instance of Pug.
stream ( $input ) : string Create a stream wrapper to allow the possibility to add $scope variables.

Méthodes protégées

Méthode Description
whiteListNeeded ( $extension ) : boolean Returns true if suhosin extension is loaded and the stream name is missing in the executor include whitelist.

Method Details

__construct() public méthode

Merge local options with constructor $options.
public __construct ( array $options = [] )
$options array

compile() public méthode

Compile PHP code from a Pug input or a Pug file.
public compile ( string $input, string $filename = null ) : string
$input string input file (or input content if filenname is specified or no file found)
$filename string filename for the input code
Résultat string

render() public méthode

Compile HTML code from a Pug input or a Pug file.
public render ( $input, $filename = null, array $vars = [] ) : string
$vars array
Résultat string

requirements() public méthode

For each of them, the value can be true if the requirement is fullfilled, false else. If a requirement name is specified, returns only the matching boolean value for this requirement.
public requirements ( $name = null ) : array | boolean
Résultat array | boolean

resetSharedVariables() public méthode

Remove all previously set shared variables.

share() public méthode

Add a variable or an array of variables to be shared with all templates that will be rendered by the instance of Pug.
public share ( $variables, mixed $value = null )
$value mixed if you pass an array as first argument, the second argument will be ignored, else it will used as the variable value for the variable name you passed as first argument

stream() public méthode

Create a stream wrapper to allow the possibility to add $scope variables.
public stream ( $input ) : string
Résultat string

whiteListNeeded() protected méthode

Returns false in any other case.
protected whiteListNeeded ( $extension ) : boolean
Résultat boolean

Property Details

$filters protected_oe property

Built-in filters.
protected array $filters
Résultat array

$sharedVariables protected_oe property

protected array $sharedVariables
Résultat array

$streamName protected_oe property

protected string $streamName
Résultat string