Welcome Guest, Not a member yet? Register   Sign In
Current page url?
#1

[eluser]DougW[/eluser]
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?
#2

[eluser]pistolPete[/eluser]
Have a look at the URI class:

Code:
$this->uri->uri_string()
#3

[eluser]DougW[/eluser]
Thanks...

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




Theme © iAndrew 2016 - Forum software by © MyBB