diff --git a/.gitignore b/.gitignore index d82837d..6630707 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ *.conf *.ini *.bak +*.lock /vendor/ /docs/ diff --git a/README.md b/README.md index 71baa0e..c73a1f4 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,55 @@ Use other full-blown templating engines for rendering complex dynamic HTML. ---- +## Installation + +Install it from Packagist: + +```bash +$ composer -vvv require bfitech/zaplate +``` + +## Sample Usage + +# template.php +```php +

+ +``` + +# renderer.php +```php +class Filter { + public function whoami($name) { + if (is_string($name)) + return $name; + return array_map(function($iname){ + if (strpos(strtolower($iname), 'jekyll') !== false) + return 'Mr Hyde'; + return $iname; + }, $name); + } +} +``` + +```php +(new Template())->load('template.php', [ + 'group' => "Extraordinary Gents", + 'members' => [ + 'Allan Quatermain', + 'Henry Jekyll', + ], [ + [(new Filter()), 'whoami'] + ] + ]); +``` + +## Documentation + Documentation available with: ```txt