I'm trying to create my custom driver using Codeigniter
Files structure:
/libraries
/Test_driver
/drivers
Test_driver_first_driver.php
Test_driver.php
Driver super class:
class Test_driver extends CI_Driver_Library
{
function __construct()
{
$this->valid_drivers = array('test_driver_first_driver');
}
}
Driver Subclass :
class Test_driver_first_driver extends CI_Driver
{
function index()
{
echo "Hello world!";
}
}
Testing code in welcome.php Controller :
$this->load->driver('test_driver');
$this->test_driver->test_driver_first_driver->index();
but the output was : "Invalid driver requested Test_driver.test_driver_first_driver". Does any one have any idea, Unfortunately Codeigniter user guide does not contains steps for creating custom driver.