Welcome Guest, Not a member yet? Register   Sign In
Config items in Libraries
#4

[eluser]xwero[/eluser]
If you want to add it to the constructor and use it in multiple methods you can use a class variable
Code:
class FantasticLibrary
{

   private $ci;

   function __construct()
   {
     $this->ci =& get_instance();
   }

   function display()
   {
     $this->ci->config->item('mailto');
   }

}


Messages In This Thread
Config items in Libraries - by El Forum - 05-22-2008, 07:29 AM
Config items in Libraries - by El Forum - 05-22-2008, 07:33 AM
Config items in Libraries - by El Forum - 05-22-2008, 08:00 AM
Config items in Libraries - by El Forum - 05-22-2008, 08:04 AM



Theme © iAndrew 2016 - Forum software by © MyBB