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.

Archive /

Our old forums are still available as a read-only archive.

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

Smarty Template Engine


Go to End


4 Posts   3461 Views

Avatar
Mat Weir

Community Member, 33 Posts

22 June 2007 at 9:53am

Has anyone considered using Smarty as Silverstripe's template engine?

Avatar
Sam

Administrator, 690 Posts

23 June 2007 at 11:55am

We wanted a templating engine that was deliberately simpler to have a cleaner separation between the logic and presentation of a site. Other templating engine such as smarty puts too many smarts into the templating engine.

I suppose it would be possible to do so on a site-by-site basis... You would need to replace the defaultAction() method of your Page_Controller to make the appropriate smarty calls.

The other thing that you would need to do is get smarty to make the appropriate calls to the ViewableData methods obj() and XML_val().

What did you see as being the advantage of using smarty?

Avatar
carnal

Community Member, 19 Posts

5 July 2007 at 1:17am

Hi Sam,

sorry for this, but at the moment it would help you, because Smarty has a great documentation ;-)

Regards

Hartmut

Avatar
Sam

Administrator, 690 Posts

8 July 2007 at 9:08pm

Documentation for the templating engine is here: http://doc.silverstripe.com/doku.php?id=templates

It may seem short but there's not that much to the templating language.

The bulk of the complexity is all the methods that are called on the controller / data object classes. The API documentation is helpful there: http://doc.silverstripe.com/assets/classes/