Welcome Guest, Not a member yet? Register   Sign In
access variable and function from a file throughout the CI project
#1

[eluser]ranjitbd[/eluser]
Code:
//i have a file name: needed_variable.php where i set all necessary array variable like //month name, day name etc frequently i needed.

//and i have another file name php_function.php where i have all necessary customise
//php function.

//i want to use those variable and function from any where every now and then.

//so in which folder i have to paste this two files and how to load these files as auto load //library. and how to access those variable and function in different method in the //controller

// please help me  with an example
#2

[eluser]jedd[/eluser]
You're very funny.

Try extending the base controller, and putting your arrays and function(s) into there.

This is described in [url="http://ellislab.com/codeigniter/user-guide/general/core_classes.html"]the CI User Guide[/url]

I see that [url="http://ellislab.com/forums/viewthread/127479/"]pistolPete also answered much the same question from you three days ago[/url].




Theme © iAndrew 2016 - Forum software by © MyBB