Coder Social home page Coder Social logo

Comments (2)

weierophinney avatar weierophinney commented on July 19, 2024

I'm not really sure I understand the use case. Right now you can setup the paths relatively to the project root and / or modules. This is done for you if you've setup your project with the skeleton.

So if you store your templates somewhere else you can set it in your config. Or if you have your templates temporary stored somewhere else you could setup the template paths in templates.local.php.

Also since TwigRenderer 1.2.0 you can have access to the Twig_Environment directly. From there you can use the getLoader() function and use prependPath(), setPaths() and all other public functions available in Twig_Loader_Filesystem.


Originally posted by @geerteltink at zendframework/zend-expressive-template#12 (comment)

from mezzio-template.

weierophinney avatar weierophinney commented on July 19, 2024

Hi @xtreamwayz ,

Thank you for looking into this. I am not looking for just one implementation. I am looking for every renderer, whether it is twig, mustache, plate or you name it.

Why ?

Say I have module X .

X
    - src
    - Module.php
    - templates

The Module.php contains something like

$template = $di->get('Zend\Expressive\Template\TemplateRendererInterface');
$template->addPath(__DIR__ . DIRECTORY_SEPARATOR . 'templates', 'example');

In the action I have the namespace to render the file.

// WelcomeAction.php
    $this->template->render('example::welcome', $data)

What I am looking with a prependPath is I can tell $template = $di->get('Zend\Expressive\Template\TemplateRendererInterface'); to add the path to the earlier added path.

You could argue that I can add the ApplicationModule.php to load first. But this is the case what I am looking for.

Hope you understand what I am looking for.

Thank you.


Originally posted by @harikt at zendframework/zend-expressive-template#12 (comment)

from mezzio-template.

Related Issues (5)

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.