PHP Class Tale\Jade\Renderer\Adapter\File

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 File renderer adapter.
render ( string $path, array $args = null ) : string Renders a jade file by a given path.

Method Details

__construct() public method

If the cache directory doesn't exist, it tries to automatically create it Possible options are: path: The path where rendered files are stored extension: The extension we should store the files with (Default: .phtml) lifeTime: The Cache lifeTime (Set to 0 to disable cache), (Default: 0)
public __construct ( Renderer $renderer, array $options = null )
$renderer Tale\Jade\Renderer the renderer instance this renderer was created in
$options array the options array for this renderer 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