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.

Data Model Questions /

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

Multiple actions per page


Go to End


4 Posts   1989 Views

Avatar
Mo

Community Member, 541 Posts

10 June 2009 at 9:20pm

Hi All,

Sorry if my naming is a bit inaccurate, I am terrible with names :s.

If I have a page with multiple actions (please correct me if these are not called actions, but something else), for example:

http://siteaddress.com/page/
http://siteaddress.com/page/action1/
http://siteaddress.com/page/action2/

I know that I can create templates for "action1" and "action2" as files:

page_action1.ss
page_action2.ss

But where do I put my php code for those actions? Are these represented by methods in page_controller? Or do i need to do something else?

Sorry for the noob question :). I cant find anything about this in the documentation, so if anyone has a link, that would be great.

Cheers,

Mo

Avatar
bummzack

Community Member, 904 Posts

10 June 2009 at 10:00pm

Hi Mo

You are right about the php-code and actions. Actions should be methods of the Controller class.
Maybe this provides some – albeit sparse – insight:
http://doc.silverstripe.com/doku.php?id=execution-pipeline

Avatar
Mo

Community Member, 541 Posts

11 June 2009 at 3:43am

Yep, your right about sparse :).

That is what I was looking for though. I have been trying to find that for ages.

Cheers!

Avatar
Mo

Community Member, 541 Posts

17 June 2009 at 12:00am

Does anyone know if there is any more detailed documentation on this?