本文整理匯總了PHP中CI_Loader::_ci_autoloader方法的典型用法代碼示例。如果您正苦於以下問題:PHP CI_Loader::_ci_autoloader方法的具體用法?PHP CI_Loader::_ci_autoloader怎麽用?PHP CI_Loader::_ci_autoloader使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CI_Loader
的用法示例。
在下文中一共展示了CI_Loader::_ci_autoloader方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
/**
* Constructor
*/
public function __construct()
{
self::$instance =& $this;
// Assign all the class objects that were instantiated by the
// bootstrap file (CodeIgniter.php) to local class variables
// so that CI can run as one big super object.
foreach (is_loaded() as $var => $class) {
$this->{$var} =& load_class($class);
}
$this->load =& load_class('Loader', 'core');
$this->load->_base_classes =& is_loaded();
$this->load->_ci_autoloader();
log_message('debug', "Controller Class Initialized");
}
示例2: _ci_autoloader
/** Autload items **/
public function _ci_autoloader()
{
parent::_ci_autoloader();
if ($this->_module) {
$autoload = array();
list($path, $file) = Modules::find('autoload', $this->_module, 'config/');
/* module autoload file */
if ($path != FALSE) {
$autoload = array_merge(Modules::load_file($file, $path, 'autoload'), $autoload);
}
/* nothing to do */
if (count($autoload) == 0) {
return;
}
/* autoload config */
if (isset($autoload['config'])) {
foreach ($autoload['config'] as $key => $val) {
$this->config($val);
}
}
/* autoload helpers, plugins, languages */
foreach (array('helper', 'plugin', 'language') as $type) {
if (isset($autoload[$type])) {
foreach ($autoload[$type] as $item) {
$this->{$type}($item);
}
}
}
/* autoload database & libraries */
if (isset($autoload['libraries'])) {
if (in_array('database', $autoload['libraries'])) {
/* autoload database */
if (!($db = self::$APP->config->item('database'))) {
$db['params'] = 'default';
$db['active_record'] = TRUE;
}
$this->database($db['params'], FALSE, $db['active_record']);
$autoload['libraries'] = array_diff($autoload['libraries'], array('database'));
}
/* autoload libraries */
foreach ($autoload['libraries'] as $library) {
$this->library($library);
}
}
/* autoload models */
if (isset($autoload['model'])) {
foreach ($autoload['model'] as $model => $alias) {
is_numeric($model) ? $this->model($alias) : $this->model($model, $alias);
}
}
}
}
示例3: Lib
function _ci_autoloader()
{
Lib(false);
// load all that has been loaded by the front controller
parent::_ci_autoloader();
}