tregor / vinder
Vinder is a free and lightweight template based engine for PHP!
This package is auto-updated.
Last update: 2025-03-09 04:36:56 UTC
README
Vinder is a free and lightweight template based engine for PHP!
You can use it as example in small projects, where there is no reasons to use another some template engines, like Smarty. Becouse of lightweight code and new improvement features, Vinder is a good solutions for devs all over the world!
Navigation
Requirements
This library is supported by PHP versions 5.4 or higher.
Installation
The preferred way to install this extension is through Composer.
To install Vinder library, simply:
$ composer require tregor/vinder
You can also clone the complete repository with Git:
$ git clone https://github.com/treggor/Vinder.git
Or install it manually:
$ wget https://github.com/tregor/Vinder/archive/master.zip
Quick Start and Usage
To use this class with Composer:
require __DIR__ . '/vendor/autoload.php'; use tregor\Vinder;
Or If you installed it manually, use it:
require_once __DIR__ . '/Vinder.php'; use tregor\Vinder;
After it you can do any your code, and than, create new Vinder object, provide template name, data array (that will be converted to vars) and optionaly set parsePHP flag (default - FALSE)
$data = [ "foo" => "bar", "greetings" => "Hello, Vinder!", ]; new Vinder("main", $data, TRUE);
Second file you will need is a template. For this example it will be:
<p style="text-align: center"><!$greetings!></p> <!$foo!>
And, after compilation and rendering you will get the same output:
<p style="text-align: center">Hello, Vinder!</p> bar
Documentation
Full documentation for Vinder you can find at wiki home page!
TODO
- Static usement of Vinder class.
- Make more settings.
- Add IF/IFELSE conditions.
- Add FOREACH, WHILE and other cycles.
- Become cooler than Smarty.
- Add tests.
Contribute
If you would like to help, please take a look at the list of issues or the ToDo checklist.
Pull requests
- Fork and clone.
- Run the tests.
- Create a branch, commit, push and send me a pull request.
License
This project is licensed under MIT license. See the LICENSE file for more info.
Copyright
By tregor 2019
Please let me know, if you have feedback or suggestions.