Git Product home page Git Product logo

li3_twig's People

Contributors

greut avatar jasonroyle avatar jperras avatar jufecara avatar marcghorayeb avatar nervetattoo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

li3_twig's Issues

How to render twig elements?

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?

Unable to extend a twig template

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

Exception when trying to render a twig template

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

Composer

Twig should be loaded via composer.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.