EllisLab text mark
Advanced Search
     
Read the config file matrix on a view file
Posted: 18 July 2007 02:50 PM   [ Ignore ]
Avatar
Joined: 2007-07-18
3 posts

Hello everybody…..

I need a little help…i want to read the matrix (basically the base_url value) in one view file. It that possible.
Or i need to pass the value throw the controller..

Thanks…


PS. sorry for my English..i working on it grin

 
Posted: 19 July 2007 04:50 PM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Avatar
Joined: 2007-07-06
11 posts

If you want to know the base url you can do simply that from the view:

<?php  echo 'The base url is: '.base_url();  ?> 

Remember to load the helper in the constructor of the controller:

$this->load->helper('url'); 
 Signature 

http://www.luisjose.com

 
Posted: 19 July 2007 05:08 PM   [ Ignore ]   [ # 2 ]   [ Rating: 0 ]
Joined: 2006-07-10
485 posts

Read the user_guide documentation for the Config class and specifically the section on Fetching Config Values. You can use that approach to selectively list the config values you need from one or more config files. There is also a method for setting config values.

 
Posted: 20 July 2007 01:38 PM   [ Ignore ]   [ # 3 ]   [ Rating: 0 ]
Avatar
Joined: 2007-07-18
3 posts

Thanks guys….that works…