CodeIgniter Forums
CodeIgniter : Loading interface <resolve> - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: CodeIgniter : Loading interface <resolve> (/showthread.php?tid=56643)



CodeIgniter : Loading interface <resolve> - El Forum - 01-08-2013

[eluser]pisio[/eluser]
Open :
./system/core/Common.php
add :
Code:
if (!function_exists('loadInterface')) {

function loadInterface($fileName) {
$file = VORTEX_INTERFACE . $fileName . EXT;

if (!file_exists($file)) {
log_message('error', 'There is no interface :[' . $file . ']');
} else {
include_once $file;
}
}

}
Open :
./application/config/constants.php

add:
Code:
define('VORTEX_INTERFACE',APPPATH.'interfaces/');

Create folder "interfaces" in "application" folder and load ....

Code:
loadInterface('VortexInterface');
class VortexCi implements VortexInterface { ...... }



It's not very smart and clean , but for now its work :}