autoload로 interface정의해서 사용하기.
별건 아니구요...
autoload를 이용하면 됩니다.
interface를 helper에 선언을 해 두시고
autoload파일에 helper에 로드 하도록 만듭니다.
$autoload['helper'] = array("interface/testInterface");
다른 helper에서 그냥 상속받아 쓰면 됩니다 -_-;
/* testinterface_helper.php */
abstract class testInterface
{
protected $m_oController = null;
function __construct()
{
$this->m_oController = &get_instance();
}
abstract function run($pParam);
}
/* testclass_helper.php */
class testClass extends testInterface
{
function __construct()
{
parent::__construct();
}
public function run($pParam)
{
print_r($this->m_oController);
return "test";
}
}
샘플 코드.
$this->load->helper("/testcode/testclass");
$o = new testClass();
$pParam = array("param1" => "param");
$o->run($pParam);
다들 알고 계셨던거라면....죄송하구요.~_~;
도움이 되셨기를 바랍니다.