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.

Customising the CMS /

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

Creating a custom controller


Go to End


3 Posts   3297 Views

Avatar
tilluigi

Community Member, 9 Posts

23 January 2009 at 6:16am

hi,

i am trying to extend a site based on the tutorial-installation and have a problem trying to create a custom controller to bypass all the Page-Object stuff. Basically, the controller should generate HTML for a slideshow based on images added to a Page via the "hasmanyfiles" module.

i am following this part of the Doku:
http://doc.silverstripe.org/doku.php?id=controller

but even if i add the exact same files as in the example, i get an error saying:

Fatal error: Class 'FastFood_Controller' not found in /var/www/html/silver/sapphire/core/control/Director.php on line 202

How do I make sapphire find my controller?

Avatar
tilluigi

Community Member, 9 Posts

23 January 2009 at 6:33am

oh my, i just used ?flush=1 and now it works. blame me!

Avatar
Richie

Community Member, 18 Posts

15 July 2009 at 9:45pm

Edited: 01/09/2009 3:16am

I you (like me!) could not retrieve these vars, use:
$getID = Director::urlParam('ID'); // argument ID