Jump to content
Wanze

Module: Twig for the TemplateEngineFactory

Recommended Posts

Hi folks!

I release a now major version 2.x of the TemplateEngineTwig module. This version is compatible with the newly released 2.x version of the TemplateEngineFactory (more details in this post). Note that the new version of the TemplateEngineFactory might break backwards compatibility, depending on the feature usage. Read the following guide on how to update, before you do so.

So what's new in version 2.0?

  • Updated Twig to 2.6.2
  • Added a setting to enable debug mode, independently from ProcessWire's debug mode.
  • The Twig_Extension_Debug is automatically loaded if debug mode is active.
  • Added unit tests and Travis for CI.

Note that this version no longer bundles Twig. Therefore, installation is only possible with Composer. This makes sure that the 3rd party dependencies are handled correctly.

If you update from 1.x to 2.x, please let me know any issues you have. If you do not update: The 1.x version of the module will stay available on the 1.x branch. For a new project, definitely pick version 2.x!

Cheers

  • Like 4

Share this post


Link to post
Share on other sites

Would it be possible to use this module to render a custom string using twig? I am looking for an easy solution to send mails, that the user can edit in the backend and insert variables, for example in the body: “Hello {{ user.fullname }}, thanks for subscribing. {{ unsubscribe }}.” Where user is the user object and unsubscribe a custom variable… Then I would pass this string to twig and send the output… Any idea on how to achieve this? (also might not be with this module…)

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...