PHP Class Tale\Jade\Renderer\Adapter\Stream

Inheritance: extends Tale\Jade\Renderer\AdapterBase
Show file Open project: talesoft/tale-jade

Public Methods

Method Description
__construct ( Renderer $renderer, array $options = null ) Creates a new stream adapter.
render ( string $path, array $args = null ) : string Renders a jade file by a given path.

Method Details

__construct() public method

Possible options are: scheme: The scheme to register the wrapper as (default: 'jade-phtml') If the stream wrapper with the given name is not registered yet, it is registered The stream wrapper used is \Tale\Jade\Renderer\Adapter\Stream\Wrapper
public __construct ( Renderer $renderer, array $options = null )
$renderer Tale\Jade\Renderer the renderer instance this adapter was created in
$options array an array of options for the adapter

render() public method

The extension can be omitted if it's the extension set in the Compiler-options ('.jade' by default) The given $args-argument should be an associative array and will be passed as variables that you can use inside the rendered template file Notice that the path is relative to the Compiler-option 'paths' or, if no paths passed, the paths in get_include_path() You might just echo the result, cache it or do anything else with it
public render ( string $path, array $args = null ) : string
$path string the relative path to be rendered
$args array the variables for the template
return string the rendered markup