Welcome Guest, Not a member yet? Register   Sign In
Read the config file matrix on a view file
#1

[eluser]Unknown[/eluser]
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 :-)
#2

[eluser]luisjose[/eluser]
If you want to know the base url you can do simply that from the view:

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

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

Code:
$this->load->helper('url');
#3

[eluser]esra[/eluser]
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.
#4

[eluser]Unknown[/eluser]
Thanks guys....that works...




Theme © iAndrew 2016 - Forum software by © MyBB