Welcome Guest, Not a member yet? Register   Sign In
Best Practice Regarding Controllers / Site Structure
#6

[eluser]Omar Vazquez[/eluser]
I usually setup one controller per resource. Any resources that have sub pages with children would be passed as method parameters. For example:

Code:
class Portfolio extends Controller{

    function index()
       {
          landing page code...
       }

     function digital($type='web')
     {
        switch($type)
          {
             case 'web':
                code here...
             break;

             case 'kiosk':
                code here...
             break;
          }
     }
}

This would yield urls like this:

www.site.com/portfolio/digital/web
www.site.com/portfolio/digital/kiosk

where "portfolio" is our controller, "digital" is our method and "web" and "kiosk" are parameters that get passed into our digital method.

See this entry in the user guide for more details on passing uri segments to your methods:
Passing URI segments to your methods

Hope that helps a bit.

Omar


Messages In This Thread
Best Practice Regarding Controllers / Site Structure - by El Forum - 10-24-2009, 10:12 AM
Best Practice Regarding Controllers / Site Structure - by El Forum - 10-24-2009, 11:07 AM
Best Practice Regarding Controllers / Site Structure - by El Forum - 10-24-2009, 11:15 AM
Best Practice Regarding Controllers / Site Structure - by El Forum - 10-24-2009, 11:50 AM
Best Practice Regarding Controllers / Site Structure - by El Forum - 10-24-2009, 05:05 PM
Best Practice Regarding Controllers / Site Structure - by El Forum - 10-25-2009, 01:41 AM
Best Practice Regarding Controllers / Site Structure - by El Forum - 10-29-2009, 04:34 AM



Theme © iAndrew 2016 - Forum software by © MyBB