PHP Класс Jade\Jade

Наследование: extends Jade\Engine\Keywords
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$filters array Built-in filters.
$sharedVariables array
$streamName string

Открытые методы

Метод Описание
__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.

Защищенные методы

Метод Описание
whiteListNeeded ( $extension ) : boolean Returns true if suhosin extension is loaded and the stream name is missing in the executor include whitelist.

Описание методов

__construct() публичный Метод

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

compile() публичный Метод

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
Результат string

render() публичный Метод

Compile HTML code from a Pug input or a Pug file.
public render ( $input, $filename = null, array $vars = [] ) : string
$vars array
Результат string

requirements() публичный Метод

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
Результат array | boolean

resetSharedVariables() публичный Метод

Remove all previously set shared variables.

share() публичный Метод

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() публичный Метод

Create a stream wrapper to allow the possibility to add $scope variables.
public stream ( $input ) : string
Результат string

whiteListNeeded() защищенный Метод

Returns false in any other case.
protected whiteListNeeded ( $extension ) : boolean
Результат boolean

Описание свойств

$filters защищенное свойство

Built-in filters.
protected array $filters
Результат array

$sharedVariables защищенное свойство

protected array $sharedVariables
Результат array

$streamName защищенное свойство

protected string $streamName
Результат string