I am using codeigniter. I defined a library in code-igniter and is expecting a parameter in its constructor.This is my library code -
################# [My Library Code Test_lib.php ] ########################
<?php
class Test_lib
{
var $params;
public function __construct($params)
{
$this->params = $params;
echo $this->params;
}
}
In codeigniter documentation, it is mentioned that you can pass the parameter in the second argument. So,I am initializing it from controller as below -
<?php
class Test_cont extends CI_Controller {
function __construct()
{
parent::__construct();
}
function test()
{
$params = "abc";
$this->load->library("test_lib",$params);
}
}
I am getting following error -
A PHP Error was encountered Severity: Warning Message: Missing argument.....
Please assist.