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.

Archive /

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

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

Scripting in the .ss files


Reply


2 Posts   1381 Views

Avatar
Tkop

28 Posts

14 July 2007 at 8:26am

How can you script in the *.ss files?

What scripting language does silverstripe use.
I thought it was php but I can't get php to
work in the *.ss files.

I tried
<% ... %>
and
<?php ?> works only for /* */ comments
// comments don't work
echo "hello"; doesn't work

I'd like to change the banner depending on what page is
displayed and putting the banner directly in the page
would limit it to the content section.

Avatar
Tim

Core Development Team, 201 Posts

14 July 2007 at 1:03pm

Edited: 14/07/2007 1:04pm

Hi Tkop

The SilverStripe template system isn't designed to support embed PHP. Our approach has been to force a clear separation between the storage, logic and presentation layers. Embedding PHP inside the templates blurs the lines between the logic and presentation layers which, architecturally, isn't desirable.

Looking at some of your previous questions, I would suggest you run through the [url=http://doc.silverstripe.com/doku.php?id=tutorials]Tutorials[/url] this should help answer this and other questions your having.