Welcome Guest, Not a member yet? Register   Sign In
Controller & access other class properties


This is a basic question about the OOP & CI.

I have a settings.php & another page (for doing the CURL operations). How can I access the values from settings.php in the Controller function?

Is it need to convert this settings.php page to a class to access it inside the Controller function?

And the operations inside the Controller function is based on the Curl class (curl.php). How can I call this class functionsfrom the Controller function ?

Please guide me..

Thank You,
Joseph An.

You can use your settings.php as a custom config file. Place it in applications/config and call it in your controller using

As for how to set up a custom config file, read the user guide: http://ellislab.com/codeigniter/user-gui...onfig.html

Thank you for your reply and the URL for getting more information about the topic.

Can I know, how can I include the external class file (for doing some operations) into my controller function ? Is it need to load the class file into the library ?

Thank You,

A config file is not a class file. It is used for settings only. If you need functions you can call, place them in a model or library and load that into your controller.

Theme © iAndrew 2016 - Forum software by © MyBB