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.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

If method=post (.ss template)

Go to End

4 Posts   1284 Views


Community Member, 197 Posts

4 July 2009 at 3:03am

I want a conditional in my .ss template for if a page was accessed via method=post.


Forum Moderator, 5523 Posts

4 July 2009 at 9:44pm

You would have to write your function in php and then call it from the template. The template has no control for this.


Community Member, 60 Posts

19 January 2011 at 3:40am

How do you 'call' php from the template then? Thanks.


Forum Moderator, 1391 Posts

19 January 2011 at 7:22am

You create a function in your Page controler, then call it from you template. Something like:

function IsPosted() {
   // check and return false or true;

<% if IsPosted %>
<% end_if %>