public function __construct() { Lib()->new_cms->load('app'); Lib()->new_cms->load('model'); }
function _ci_autoloader() { Lib(false); // load all that has been loaded by the front controller parent::_ci_autoloader(); }
/** * Static accessor for all models. * * @param string The path to the file relative to the models dir * @param string The database connection to use * @return object */ function &Model($model, $db_conn = '') { static $models = array(); // already loaded? if (isset($models[$model])) { return $models[$model]; } if (!class_exists('Model')) { load_class('Model', 'core'); } if (!Finder::load_file($model, 'models', false)) { show_error('Unable to locate the model you have specified: ' . $model); } if (($p = strrpos($model, '/')) !== false) { $model = substr($model, $p + 1); } // $model .= '_Model'; $models[$model] = new $model(); // load the database if ($db_conn !== false) { $models[$model]->db = Lib('loader')->database($db_conn === true ? '' : $db_conn, true); } // reference other libs // $models[$model]->_assign_libraries(); return $models[$model]; }