unionofrad / li3_twig Goto Github PK
View Code? Open in Web Editor NEWThis project forked from nervetattoo/li3_twig
Lithium Twig integration. Replaces Lithium's basic PHP template engine.
This project forked from nervetattoo/li3_twig
Lithium Twig integration. Replaces Lithium's basic PHP template engine.
How does one render a twig element? I first modified the li3_twig media type configuration and added a path for 'element':
Media::type('twig', array('text/html', 'application/xhtml+xml', '*/*'), array(
'view' => 'li3_twig\template\View',
'loader' => 'li3_twig\template\Loader',
'renderer' => 'li3_twig\template\view\adapter\Twig',
'paths' => array(
'template' => array(
'{:library}/views/{:controller}/{:template}.html.twig',
'{:library}/views/layouts'
),
'element' => array(
'{:library}/views/elements/{:template}.html.twig'
)
),
'conditions' => array('type' => true)
));
Then I attempted to render a twig element:
<?= $this->_render('element', 'menu', array(), array('type' => 'twig')) ?>
This raises a "Template not found" exception. Doesn't seem like it even detected or tried the element path configured above. Looking at the stack trace, it attempted to use the element paths configured under the default media type (app/config/bootstrap/media.php).
What am I missing here?
Hello,
How can we extend a default template. When i try to do like that:
{% extends '../layout/defaut.html.twig' %}
I get an exception:
Fatal error: Uncaught exception 'Twig_Error_Loader' with message 'Looks like you try to load a template outside configured >directories (../layout/defaut.html.twig) i
Thanks
Fatal error: Uncaught exception 'RuntimeException' with message 'Helper `TwigExtensions` not found.' in /home/razielgn/dev/php/dreamboard/li3_test_sprint/libraries/lithium/template/view/Renderer.php:308
Stack trace:
#0 /home/razielgn/dev/php/dreamboard/li3_test_sprint/libraries/li3_twig/template/view/adapter/Twig.php(120): lithium\template\view\Renderer->helper('TwigExtensions')
#1 /home/razielgn/dev/php/dreamboard/li3_test_sprint/libraries/lithium/core/Object.php(93): li3_twig\template\view\adapter\Twig->_init()
#2 /home/razielgn/dev/php/dreamboard/li3_test_sprint/libraries/lithium/template/view/Renderer.php(172): lithium\core\Object->__construct(Array)
#3 /home/razielgn/dev/php/dreamboard/li3_test_sprint/libraries/li3_twig/template/view/adapter/Twig.php(80): lithium\template\view\Renderer->__construct(Array)
#4 /home/razielgn/dev/php/dreamboard/li3_test_sprint/libraries/lithium/core/Libraries.php(628): li3_twig\template\view\adapter\Twig->__construct(Array)
#5 /home/razielgn/dev/php/dreamboard/li3_test_sprint/libraries/ in /home/razielgn/dev/php/dreamboard/li3_test_sprint/libraries/lithium/template/view/Renderer.php on line 308
Twig should be loaded via composer.
Found your fork of @nervetattoo's "original", but there's nothing connecting it to any of the @UnionOfRAD repositories. Looks like yours is better maintained... Have you "officially" taken over maintenance of li3_twig
...?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.