• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Current page url?

I am trying to consolidate all of my meta information into a database so that I can use one wrapper view to construct all of my pages. The only way I can see to provide meta data for all the pages is to put it in a database and load it, then pass it to the wrapper controller.

The database has a field called pageurl which is of the format site/controller/function. To make this more complicated, i have a 'generic' controller which is always called before the requested controller. I want a single load of the meta data in this 'generic' controller so the code is always in just one place.

What I need is a system variable or some way to know what the current requested site/controller/function is. Is there a codeigniter variable for this? Or should I just use the php $_SERVER[] variable for request?

Have a look at the URI class:



Turns out that SERVER['REQUEST_URI'] works fine. I don't like building too much dependence on the framework.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

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