Compile


This library includes methods that are related to the reading and compilation of template files. This includes registering custom tags and filters.


Properties

No public properties available.


compile()

This will initiate a compile session for a source file. Typically you do not need to call this method directly as it is called from the template library when needed.

$this->zajlib->compile->compile($source_path, $destination_path=false)

@param string $source_path This is the source file’s path relative to any of the active view folders.
@param bool|string $destination_path This is the destination file’s path relative to the final compiled view folder. If not specified, the destination will be the same as the source (relative), which is the preferred way of doing things. You should only specify this if you are customizing the template compilation process.
@return boolean Will return false, but that does not mean it was a failure. Failures are either fatal or displayed inline.

register_tags()

Registering tags will make the list of tags in the specified tag file available for use. You can read more about creating your own custom tags here. Built-in tags are loaded automatically which include “base” (the Django-inspired set) and “mozajik” (the Outlast Framework extension). Read more about built-in tags here.

$this->zajlib->compile->register_tags($name_of_tag_collection)

@param string $name The name of the tags collection. Tag collections need to be placed in a file within any of your active plugins: /tags/$name.tags.php
@return void Returns nothing. Fatal error thrown if tag collection does not exist.

register_filters()

Registering filters will make the list of filters in the specified filter file available for use. You can read more about creating your own custom filters here. Built-in filters are loaded automatically which include “base” (the Django-inspired set) and “mozajik” (the Outlast Framework extension). Read more about built-in filters here.

$this->zajlib->compile->register_filters($name_of_filter_collection)

@param string $name The name of the filters collection. Filter collections need to be placed in a file within any of your active plugins: /filters/$name.filters.php
@return void Returns nothing. Fatal error thrown if tag collection does not exist.

source_exists()

Returns true if a template file exists anywhere in the available paths based on the source path. A shorter and more semantic version of this method is $this->zajlib->template->exists().

@param string $source_path The source path to check for.
@return boolean Returns true if found, false if not.

Outlast Web & Mobile Development (c) 2018 | Privacy Policy |