Welcome Guest, Not a member yet? Register   Sign In
User's library can't use the __construct method passing parameters???
#1

today i create a library with a method __construct ,and the construct method have two parameters ,it's like this
Class Test
{
     private $a;
     public  function __construct($b)
     {
            $this->a = $b;
      }
      public function show()
      {
            echo $this->a;
       }
 }

but when i load the this library in  my controller, it posts an error saying that the __construct method missing one parameter

so the question is that is the library in Codeigniter can't use the __construct() method to passing parameters???????

help please........
Reply


Messages In This Thread
User's library can't use the __construct method passing parameters??? - by leonhou - 03-10-2016, 06:16 PM



Theme © iAndrew 2016 - Forum software by © MyBB