Jump to:

17452 Posts in 4473 Topics by 1971 members


SilverStripe Forums » Archive » Scripting in the .ss files

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

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

Page: 1
Go to End
Author Topic: 1355 Views
  • Tkop
    28 Posts

    Scripting in the .ss files Link to this post

    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
    <% ... %>
    <?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.

  • Tim
    Core Development Team
    201 Posts

    Re: Scripting in the .ss files Link to this post

    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 Tutorials this should help answer this and other questions your having.

Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.