Recommend this page to a friend! |
Download .zip |
Info | Documentation | View files (14) | Download .zip | Reputation | Support forum | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2020-07-07 (2 months ago) | Not yet rated by the users | Total: 71 | All time: 9,681 This week: 157 |
Version | License | PHP version | Categories | |||
mezon-html-template 1.0 | MIT/X Consortium ... | 5 | HTML, PHP 5, Templates |
Description | Author | |
This package can be used process HTML templates replacing variables. |
Just type
composer require mezon/html-template
First of all you need to create object
$template = new \Mezon\HtmlTemplate\HtmlTemplate('./main-template/');
This code assumes that you have all template resources in the directory './main-template/'
But you can also specify a list of paths, and while template compilation they all will be scanned for static files.
$template = new \Mezon\HtmlTemplate\HtmlTemplate(['./main-template/', './extra-files/res/']);
No need to specify all paths in the constructor. You can do it later with methods:
$template = new \Mezon\HtmlTemplate\HtmlTemplate('./main-template/');
$template->addPaths(['./path1', './path2']);
But be carefull if you have static files with the same names on different paths. While compilation the file on the latest added path will be used. It was done so to create a sort of overriding mechanism for template resources.
Or you can completely reset all paths:
$template->setPaths(['./path1', './path2']);
And view a list of paths:
var_dump($template->getPaths());
Files |
File | Role | Description | ||
---|---|---|---|---|
Tests (2 files, 2 directories) | ||||
.travis.yml | Data | Auxiliary data | ||
composer.json | Data | Auxiliary data | ||
composer.lock | Data | Auxiliary data | ||
HtmlTemplate.php | Class | Class source | ||
phpunit.xml | Data | Auxiliary data | ||
README.md | Doc. | Documentation | ||
TemplateResources.php | Class | Class source |
Files | / | Tests |
File | Role | Description | ||
---|---|---|---|---|
res (1 file, 1 directory) | ||||
test-data (1 directory) | ||||
HtmlTemplateUnitTest.php | Class | Class source | ||
TemplateResourcesUnitTest.php | Class | Class source |
mezon-html-template-2020-07-07.zip 15KB | |
mezon-html-template-2020-07-07.tar.gz 12KB | |
Install with Composer |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.