5101 Posts in 1519 Topics by 1116 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 694 Views |
-
Does everything user-facing need to be in a page?

23 February 2010 at 11:24pm
Not sure if this is the right place to ask, but does every function of a site or application that has some user-facing component to it need to be in a page, i.e. in the admin site content tree?
For example, if I have a module that supplies an AJAX form item, does that module need to supply a page in the site structure to serve the AJAX requests? Or can user-serving URLs bypass the site structure tree completely and just go direct to a module?
-- Jason
-
Re: Does everything user-facing need to be in a page?

24 February 2010 at 2:52pm
It doesn't need a page, you can simply have a plain jane controller which returns the data. Something like AjaxController extends Controller then you can call functions like site.com/AjaxController/function or to make it nicer you can add your own Director rules to make a 'nice' url like site.com/ajax/function which uses the AjaxController class
http://doc.silverstripe.org/doku.php?id=controller
http://doc.silverstripe.org/doku.php?id=director#default_rewrite_rules -
Re: Does everything user-facing need to be in a page?

24 February 2010 at 10:24pm
I just discovered the Director class last night - it explains a lot. Thanks.
-- Jason
| 694 Views | ||
|
Page:
1
|
Go to Top |


