Newbie question - global variable in codeigniter |
[eluser]Đỗ Thanh Tùng[/eluser]
Hi all, I'm a newbie. I have a problem when using variable in CodeIgniter. I have a class like this : Code: Class abc Extends Controller { It return empty. How can I reuse the variable without send it's param again ? Thanks for help.
[eluser]Đỗ Thanh Tùng[/eluser]
Can anybody show me how to use a global variable that I can use in both function a and b ?
[eluser]Đỗ Thanh Tùng[/eluser]
I need something like this http://ellislab.com/forums/viewthread/80719/ Need a real example.
[eluser]Đỗ Thanh Tùng[/eluser]
Thanks inparo. I think using session is not the correct way but that is the simplest way can fix my problem now. Thanks a lot.
[eluser]Senthilguru[/eluser]
Global variable Declaration.. declare it in config file : location.... system/application/config/config.php Code: $config['site_name'] = 'XXXXXXXXXXXXXXXXXXXX'; get anywhere like this.... Code: $this->config->item('site_name'); Cheers, Senthilguru.E www.cogzidel.in |
Welcome Guest, Not a member yet? Register Sign In |