• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to create dynamically controllers function name in codeigniter

#11
[eluser]beeLoop[/eluser]
[quote author="PhilTem" date="1350320024"]If you want to understand the usage of a bootstrap-controller, you should really consider starting to read through index.php and all files that are included in index.php and basically follow the business logic/flow of CI to see what a bootstrap controller can do and how you can use it best Wink[/quote]

Seems i have to edit CI's root folder for initiating bootstrap controller. IS there any other way to create controllers dynamically.
I am running out of time.

I need to load some view based on user's name(as per my project requirement) appended exactly after the base_url(). So in CI terms, the user's name will be the name of controllers (its index function) which will be called.

All users are in database. So How i will route them to a controller name which will be called, when the user's name match with controller's name?
So i need to create a dynamic controller, whose name will match with user's and load accordingly.

How to achieve this in codeigniter??


#12
[eluser]alexwenzel[/eluser]
[quote author="beeLoop" date="1350366561"][quote author="PhilTem" date="1350320024"]If you want to understand the usage of a bootstrap-controller, you should really consider starting to read through index.php and all files that are included in index.php and basically follow the business logic/flow of CI to see what a bootstrap controller can do and how you can use it best Wink[/quote]

Seems i have to edit CI's root folder for initiating bootstrap controller. IS there any other way to create controllers dynamically.
I am running out of time.

I need to load some view based on user's name(as per my project requirement) appended exactly after the base_url(). So in CI terms, the user's name will be the name of controllers (its index function) which will be called.

All users are in database. So How i will route them to a controller name which will be called, when the user's name match with controller's name?
So i need to create a dynamic controller, whose name will match with user's and load accordingly.

How to achieve this in codeigniter??

[/quote]

Except the methods we discussed above, there is no clean solution to solve your problem.

- routing in general
- routing to one controller method
- using hooks

#13
[eluser]Aken[/eluser]
Ahem...

[quote author="Aken" date="1350081544"]Use the 404 override controller method.[/quote]

#14
[eluser]alexwenzel[/eluser]
[quote author="Aken" date="1350371478"]Ahem...

[quote author="Aken" date="1350081544"]Use the 404 override controller method.[/quote][/quote]

ah, right. almost forgot your suggestion. this is probably the best way to go!

#15
[eluser]beeLoop[/eluser]
[quote author="Aken" date="1350371478"]Ahem...

[quote author="Aken" date="1350081544"]Use the 404 override controller method.[/quote][/quote]

Hey i didn't get how to achieve my requirement using 404 override controller method.
Put some more light how to achieve it using 404 override controller method.
Smile


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.