Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Themes /

Discuss SilverStripe Themes.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Using Twig template engine with SilverStripe


Go to End


1657 Views

Avatar
chris-hall-hu

Community Member, 2 Posts

26 October 2015 at 11:06pm

I am experimenting with using Twig template engine within Silverstripe by getting a version of the Simple theme to work with Twig https://github.com/chris-hall-hu/simple-silverstripe-twig.

I am using a fork of https://github.com/camspiers/silverstripe-twig to make twig available so that I can add extensions, functions etc.

Probably going to be a bit of slow-burner have little free time at the moment, and have only just started learning Silverstripe, really I am looking for options next year probably after SS version 4 is released, doing this is helping me learn Silverstripe, plus I want to get a better knowledge of Twig under the hood.

It may well be better to just use different approaches with Twig, however there is probably a benefit to making options to work with require, $layout etc. etc. so far just got require working.

I am not proposing replacing SS templating with Twig wholesale the native templating looks pretty good already ;), personally though I may have need to work with multiple frameworks and people who already know Twig, possibly with some custom Twig extensions also.

Any comments or heads-up re. things I may have problems with gratefully received.