halaxa / zf2-latte
Zf2 module for Latte templating engine integration
Requires
- php: >=5.3.3
- latte/latte: 2.2.*@dev
- zendframework/zendframework: 2.*
Requires (Dev)
- nette/tester: ~1.1
- tracy/tracy: dev-master
This package is auto-updated.
Last update: 2021-03-13 18:44:20 UTC
README
Latte integration module to Zend Framework 2
Latte is state of the art templating system, part of Nette framework, leaving others behind mainly in powerful XSS defence.
Work in progress
This is not a stable solution yet. Feel free to participate on development:)
What it does
Basic latte support works. Zend view helpers work by accessing $helper
object in template.
{$helper->headScript()} {* will be printed and escaped *} {?$helper->headScript()} {* will not be printed *}
Layouts work. It by default disables native layout in ZF, as Latte has great and simple support for them, also supporting multiple layouts depending on template. If you still want to use default ZF layout system in some actions, you can. It disables is only if latte template is active template.
Translation macro {_}
is configurable via 'translator_callback' key.
Loads template_map
and template_path_stack
.
Supports n:href
which maps to $helper->url()
. Can be used like this even if you use PHP without short array syntax []:
<a n:href="application, [controller => application, action => index]">link</a>
What it does not (yet)
Macros like control
, form
and similar are not present, as they are based on Nette internal components.
Installation
This is composer package. For library instalation include into your composer.json
following line
"require": { "halaxa/zf2-latte": "dev-master" }
For development installation and running tests you can do something like:
composer create-project halaxa/zf2-latte zf2-latte dev-master --prefer-source --no-install --keep-vcs
cd zf2-latte
composer install --prefer-dist --dev
./vendor/bin/tester test/tests