Welcome Guest, Not a member yet? Register   Sign In
Controller in subfolder, url parameters offset
#2

[eluser]Narkboy[/eluser]
Honestly, I looked at controllers in sub-folders and gave up. The confusion over URIs becomes too much of a pain. If it works for you, then great - and yes, Q1 you do have the right format.

For Q2 - are you always expecting an ID in the URI? If so then just write your controller function as
Code:
function some_page($id)

CI does the work of parsing the URI anyway - to load anything at all it has to read the admin directory for the school class and then load the update function. Variables in the function declaration are extensions of that. If you may or may not recieve an id, then remember to give it a default value in the function declaration and handle the default version first.

From a personal standpoint, I would avoid using subfolders unless you really have to. Just me not liking the URI results!

Smile


Messages In This Thread
Controller in subfolder, url parameters offset - by El Forum - 04-27-2010, 10:12 PM
Controller in subfolder, url parameters offset - by El Forum - 04-28-2010, 03:49 AM
Controller in subfolder, url parameters offset - by El Forum - 04-28-2010, 03:52 AM
Controller in subfolder, url parameters offset - by El Forum - 04-28-2010, 03:57 AM
Controller in subfolder, url parameters offset - by El Forum - 04-28-2010, 11:35 AM



Theme © iAndrew 2016 - Forum software by © MyBB