$_renderer
$_renderer : \Tale\Jade\Renderer
The renderer this adapter got created in.
Handles rendering via Data-URIs and a PHP Stream Wrapper.
Notice that this only works, if the php.ini setting 'allow_url_fopen' is ON This works through including the PHTML file as an URI
It's safe to use! Everything happens locally.
The following happens:
We register a PHP Stream Wrapper for the 'jade-phtml'-scheme that does the following:
This way, the PHTML acts like a normal PHP file
Advantages:
Disadvantages:
$_renderer : \Tale\Jade\Renderer
The renderer this adapter got created in.
__construct(\Tale\Jade\Renderer $renderer, array|null $options = null)
Creates a new stream adapter.
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
\Tale\Jade\Renderer | $renderer | the renderer instance this adapter was created in |
array|null | $options | an array of options for the adapter |
getRenderer() : \Tale\Jade\Renderer
Returns the attached renderer this adapter was created in.
render(string $path, array|null $args = null) : string
Renders a jade file by a given path.
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
string | $path | the relative path to be rendered |
array|null | $args | the variables for the template |
the rendered markup