Welcome Guest, Not a member yet? Register   Sign In
One controller?
#1

[eluser]matt2012[/eluser]
I would like to route everything though a single controller I will then grab the correct view by inspecting the url how can I route everything though say home controller
#2

[eluser]matt2012[/eluser]
Code:
$route['(.*)'] = "welcome";

this seems to work..
#3

[eluser]bretticus[/eluser]
Just out of curiosity. Is this for relatively static views in your website (in addition to to possibly more complex controllers and methods elsewhere in the application?) By setting your route to direct everything to the welcome controller, you have to setup a route for anything else also. That may get cumbersome, but, then again, I have no idea what you are trying to do and, for all I know, you have a perfectly legitimate reason for doing so.

If I am close to the mark, you might try using a _remap method to accomplish what you want for one controller and avoid messing with such a restrictive route.
#4

[eluser]matt2012[/eluser]
Im not sure if what im trying makes sense!

Basically having used a typical MVC approach and a more modular MVC I think both approaches are wrong. For a web page neither webpages or modules are the core unit. Widgets/pageblocks are so im trying to write a site where each page view calls the same action (i.e. the controller/action is always the same)

My idea is that you have one skinny controller that all page calls go to this controller.

So if you called admin/members/var/34/234 it will get the config for that page from admin_members.json and use 34 and 234 as param1, param2 respectively. The json will then pull out what widgets should appear on the page.

The widgets are made of smaller components wiglets?

each wiglet being generic can be used extensively ie a wiglet could be a static piece of html, a field from a database, a google map, a form (which is again broken into generic bits)

anyway thats the sort of idea!




Theme © iAndrew 2016 - Forum software by © MyBB