PHP 클래스 MY_Loader, CodeIgniter-HMVC

상속: extends MX_Loader
파일 보기 프로젝트 열기: hex-ci/CodeIgniter-HMVC 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$_ci_autoload_libraries 当前 Module 的控制器名
$_ci_autoload_models 自动装载的类库名数组
$_ci_is_inside_module
$_ci_module_class 当前 Module 所在路径
$_ci_module_method 当前 Module 的调用 URI
$_ci_module_models 当前 Module 执行的方法
$_ci_module_path 当前是否是 Module 里的 Loader
$_ci_module_uri 自动装载的模型名数组

공개 메소드들

메소드 설명
__construct ( ) Constructor
_ci_module_ready ( $class_path, $class_name ) Module 中的 Loader 类实例初始化时,自动调用此函数
config ( string $file, boolean $use_sections = FALSE, boolean $fail_gracefully = FALSE ) : boolean Config Loader
database ( mixed $params = '', boolean $return = FALSE, boolean $query_builder = NULL ) : object | boolean Database Loader
dbforge ( object $db = NULL, boolean $return = FALSE ) : object Load the Database Forge Class
dbutil ( object $db = NULL, boolean $return = FALSE ) : object Load the Database Utilities Class
get_base_classes ( ) 获取 _base_classes 属性
language ( string | string[] $files, $lang = '' ) : object Language Loader
model ( string $model, string $name = '', boolean $db_conn = FALSE ) : object Model Loader
module ( $module_uri, $vars = [], $return = FALSE ) : void Module Loader
module_url ( $uri, $controller_name = '' ) : string 取当前 Module 某方法的 URL 地址
view ( string $view, array $vars = [], boolean $return = FALSE ) : object | string View Loader

보호된 메소드들

메소드 설명
_ci_get_component ( string $component ) : boolean CI Component getter
_ci_init_library ( string $class, string $prefix, array | null | boolean $config = FALSE, string $object_name = NULL ) : void Internal CI Library Instantiator
_ci_load ( array $_ci_data ) : object Internal CI Data Loader
_ci_load_library ( string $class, mixed $params = NULL, string $object_name = NULL ) : void Internal CI Library Loader
_ci_load_stock_library ( $library_name, string $file_path, mixed $params, string $object_name ) : void Internal CI Stock Library Loader

비공개 메소드들

메소드 설명
get_instance ( ) 根据是否在模块中来取超级对象

메소드 상세

__construct() 공개 메소드

Sets the path to the view files and gets the initial output buffering level
public __construct ( )

_ci_get_component() 보호된 메소드

Get a reference to a specific library or model.
protected _ci_get_component ( string $component ) : boolean
$component string Component name
리턴 boolean

_ci_init_library() 보호된 메소드

Internal CI Library Instantiator
protected _ci_init_library ( string $class, string $prefix, array | null | boolean $config = FALSE, string $object_name = NULL ) : void
$class string Class name
$prefix string Class name prefix
$config array | null | boolean Optional configuration to pass to the class constructor: FALSE to skip; NULL to search in config paths; array containing configuration data
$object_name string Optional object name to assign to
리턴 void

_ci_load() 보호된 메소드

Used to load views and files. Variables are prefixed with _ci_ to avoid symbol collision with variables made available to view files.
protected _ci_load ( array $_ci_data ) : object
$_ci_data array Data to load
리턴 object

_ci_load_library() 보호된 메소드

Internal CI Library Loader
protected _ci_load_library ( string $class, mixed $params = NULL, string $object_name = NULL ) : void
$class string Class name to load
$params mixed Optional parameters to pass to the class constructor
$object_name string Optional object name to assign to
리턴 void

_ci_load_stock_library() 보호된 메소드

Internal CI Stock Library Loader
protected _ci_load_stock_library ( $library_name, string $file_path, mixed $params, string $object_name ) : void
$file_path string Path to the library filename, relative to libraries/
$params mixed Optional parameters to pass to the class constructor
$object_name string Optional object name to assign to
리턴 void

_ci_module_ready() 공개 메소드

Module 中的 Loader 类实例初始化时,自动调用此函数
public _ci_module_ready ( $class_path, $class_name )

config() 공개 메소드

Loads a config file (an alias for CI_Config::load()).
public config ( string $file, boolean $use_sections = FALSE, boolean $fail_gracefully = FALSE ) : boolean
$file string Configuration file name
$use_sections boolean Whether configuration values should be loaded into their own section
$fail_gracefully boolean Whether to just return FALSE or display an error message
리턴 boolean TRUE if the file was loaded correctly or FALSE on failure

database() 공개 메소드

Database Loader
public database ( mixed $params = '', boolean $return = FALSE, boolean $query_builder = NULL ) : object | boolean
$params mixed Database configuration options
$return boolean Whether to return the database object
$query_builder boolean Whether to enable Query Builder (overrides the configuration setting)
리턴 object | boolean Database object if $return is set to TRUE, FALSE on failure, CI_Loader instance in any other case

dbforge() 공개 메소드

Load the Database Forge Class
public dbforge ( object $db = NULL, boolean $return = FALSE ) : object
$db object Database object
$return boolean Whether to return the DB Forge class object or not
리턴 object

dbutil() 공개 메소드

Load the Database Utilities Class
public dbutil ( object $db = NULL, boolean $return = FALSE ) : object
$db object Database object
$return boolean Whether to return the DB Utilities class object or not
리턴 object

get_base_classes() 공개 메소드

获取 _base_classes 属性
public get_base_classes ( )

language() 공개 메소드

Loads language files.
public language ( string | string[] $files, $lang = '' ) : object
$files string | string[] List of language file names to load
리턴 object

model() 공개 메소드

Loads and instantiates models.
public model ( string $model, string $name = '', boolean $db_conn = FALSE ) : object
$model string Model name
$name string An optional object name to assign to
$db_conn boolean An optional database connection configuration to initialize
리턴 object

module() 공개 메소드

This function lets users load and instantiate module.
public module ( $module_uri, $vars = [], $return = FALSE ) : void
리턴 void

module_url() 공개 메소드

取当前 Module 某方法的 URL 地址
public module_url ( $uri, $controller_name = '' ) : string
리턴 string

view() 공개 메소드

Loads "view" files.
public view ( string $view, array $vars = [], boolean $return = FALSE ) : object | string
$view string View name
$vars array An associative array of data to be extracted for use in the view
$return boolean Whether to return the view output or leave it to the Output class
리턴 object | string

프로퍼티 상세

$_ci_autoload_libraries 공개적으로 프로퍼티

当前 Module 的控制器名
public $_ci_autoload_libraries

$_ci_autoload_models 공개적으로 프로퍼티

自动装载的类库名数组
public $_ci_autoload_models

$_ci_is_inside_module 공개적으로 프로퍼티

public $_ci_is_inside_module

$_ci_module_class 공개적으로 프로퍼티

当前 Module 所在路径
public $_ci_module_class

$_ci_module_method 공개적으로 프로퍼티

当前 Module 的调用 URI
public $_ci_module_method

$_ci_module_models 공개적으로 프로퍼티

当前 Module 执行的方法
public $_ci_module_models

$_ci_module_path 공개적으로 프로퍼티

当前是否是 Module 里的 Loader
public $_ci_module_path

$_ci_module_uri 공개적으로 프로퍼티

自动装载的模型名数组
public $_ci_module_uri