Feature #363
add support for sf 2 twig template
| Status: | Resolved | Start: | 01/{{count}}/2012 | |
|---|---|---|---|---|
| Priority: | Low | Due Date:: | ||
| Assigned to: | - | % Done: | 0% |
|
| Category: | Plugins | |||
| Target version: | 0.9.14 |
Description
Associated revisions
Revision 6f4c47a1f1f182a7d49b52d029309b5e85e938f6
refs #363: add sf2 template engine implementation for ZenMagick PHP templates (still inactive)
Revision 503ec191eb03410f060ba99f805994c9c6d3e43b
refs #363: allow multiple engines, fix wrong variable name
Revision aa3677501d1ec83f8c5f36face3819e2ba338852
refs #363: implement more loader/locator that use the ZenMagick ResourceResolver and get basic twig working
Revision 9708475c558df31fa41acb7160e6ac65bdb7e961
refs #363:
- cleanup View methods (more to be done)
- move methods from View into ZMPhpEngine that do not belong in View
- change Widget interface to reflect the interface changes
- rename View TemplateView and make View a base interface
Revision a942f1f03170183b3d6fb04457cf213e99e31297
refs #363: rename service id 'view' to 'templateView'
History
Updated by Martin Rademacher 4 months ago
- Category set to Plugins
- Target version set to 1.0
Updated by Martin Rademacher 4 months ago
- Status changed from New to In Progress
- added twig to bin/vendors.php
- added twig to classloader (note: this is using the ZM loader via classloader.ini, not twigs autoloader)
- added sf2 Templating and TwigBundle to classloader
This should be enough to get keen people started experimenting, This, for example, works nicely in my local.php (which I use as scatchpad..)
$loader = new Twig_Loader_String();
$twig = new Twig_Environment($loader);
echo $twig->render('Hello {{ name }}!', array('name' => 'mano'));
Updated by Martin Rademacher 4 months ago
Also, this works too and might be a step to using sf2 templating...
use Symfony\Component\Templating\PhpEngine;
use Symfony\Component\Templating\TemplateNameParser;
use Symfony\Component\Templating\Loader\FilesystemLoader;
$tnp = new TemplateNameParser();
$l = new FilesystemLoader();
$pe = new PhpEngine($tnp, $l);
echo $pe->render(dirname(__FILE__).'/foo.php');
Updated by Martin Rademacher 4 months ago
Consider refactoring part of the current view code into a sf2 compatible template engine and change View to pick the engine that can handle a give template
Updated by Martin Rademacher 4 months ago
- Target version changed from 1.0 to 0.9.15
Updated by Martin Rademacher 4 months ago
- Target version changed from 0.9.15 to 0.9.14
Updated by Martin Rademacher 4 months ago
Progressing nicely, with only one (rather ugly) issue left:
Store emails send from admin can't use twig templates - well, at least not within a store context.
Updated by Martin Rademacher 3 months ago
- Status changed from In Progress to Resolved
I would consider this done for now - you can use twig, although with limitations. If those limits are an issue we should have separate tracker to handle those.
- Twig templating is not available for emails in admin
- No integration/tools/macros or anything else beside providing the same template vars that we have in ZenMagick PHP templates