Retrieving URL's from an includes file? |
[eluser]TallowMan[/eluser]
Hi All, Been using Codeigniter now for about a month, and I must say it's changed my world :-) After searching through the user manual and google, there is one thing I haven't been able to find an answer to though. Back in the dark days before codeigniter, I would have all my internal site URL's in an includes file, with URL variables assigned as such: $home_URL = "home.php", as a quick example. Therefore, saving me from hunting through the code if a URL had to change. Is there an MVC way of doing this, or a specific codeigniter way of doing this, or do I just call in an includes file as before, leading to "echo site_url($home)"? Thanks for taking the time to read. TallowMan
[eluser]rogierb[/eluser]
If you want to use an internal reference to a url, you could create a new config file and store your urls there. Then autoload that config and user the values. I rather use Routes see http://ellislab.com/codeigniter/user-gui...uting.html since that is the CI way of doing things. Not really what you asked though.
[eluser]TallowMan[/eluser]
I had a look at Routes, but wasn't sure it was exaclty what I was looking for. Maybe I just didn't understand it properly! But since you mentioned it, I'll have another look, as I would prefer to be doing things the 'CI way'. Cheers, TallowMan |
Welcome Guest, Not a member yet? Register Sign In |