-
Notifications
You must be signed in to change notification settings - Fork 0
Class CI_Loader
##Class CI_Loader
Loader Class
Loads views and files
Package: [[CodeIgniter<a href="Package CodeIgniter.Libraries.md">Libraries]]
Category:
Loader
Author:
ExpressionEngine Dev Team
Link:
http://codeigniter.com/user_guide/libraries/loader.html
Located at system/core/Loader.php
##Methods summary
public __construct ( )
Constructor
Sets the path to the view files and gets the initial output buffering level
public object initialize ( )
Initialize the Loader
This method is called once in CI_Controller.
Returns
object
public mixed is_loaded ( string $class )
Is Loaded
A utility function to test if a class is in the self::$_ci_classes array. This function returns the object name if the class tested for is loaded, and returns FALSE if it isn't.
It is mainly used in the form_helper -> _get_validation_object()
Parameters
$class
string
class being checked for
Returns
mixed
class object name on the CI SuperObject or FALSE
public library ( string $library = '', mixed $params = NULL, string $object_name = NULL )
Class Loader
This function lets users load and instantiate classes. It is designed to be called from a user's app controllers.
Parameters
$library
string
the name of the class
$params
mixed
the optional parameters
$object_name
string
an optional object name
public model ( string $model, string $name = '', boolean $db_conn = FALSE )
Model Loader
This function lets users load and instantiate models.
Parameters
$model
string
the name of the class
$name
string
name for the model
$db_conn
boolean
database connection
public object database ( string $params = '', boolean $return = FALSE, boolean $active_record = NULL )
Database Loader
Parameters
$params
string
the DB credentials
$return
boolean
whether to return the DB object
$active_record
boolean
whether to enable active record (this allows us to override the config setting)
Returns
object
public string dbutil ( )
Load the Utilities Class
Returns
string
public string dbforge ( )
Load the Database Forge Class
Returns
string
public view ( string $view, array $vars = array(), boolean $return = FALSE )
Load View
This function is used to load a "view" file. It has three parameters:
- The name of the "view" file to be included.
<li>An associative array of data to be extracted for use in the view.</li>
<li>TRUE/FALSE - whether to return the data or load it. In</li>
some cases it's advantageous to be able to return data so that a developer can process it in some way.
Parameters
$view
string
$vars
array
$return
boolean
public string file ( string $path, boolean $return = FALSE )
Load File
This is a generic file loader
Parameters
$path
string
$return
boolean
Returns
string
public vars ( array $vars = array(), string $val = '' )
Set Variables
Once variables are set they become available within the controller class and its "view" files.
Parameters
$vars
array
$val
string
public get_var ( array $key )
Get Variable
Check if a variable is set and retrieve it.
Parameters
$key
array
public helper ( mixed $helpers = array() )
Load Helper
This function loads the specified helper file.
Parameters
$helpers
mixed
public helpers ( array $helpers = array() )
Load Helpers
This is simply an alias to the above function in case the user has written the plural form of this function.
Parameters
$helpers
array
public language ( array $file = array(), string $lang = '' )
Loads a language file
Parameters
$file
array
$lang
string
public config ( string $file = '', boolean $use_sections = FALSE, boolean $fail_gracefully = FALSE )
Loads a config file
Parameters
$file
string
$use_sections
boolean
$fail_gracefully
boolean
public driver ( string $library = '', mixed $params = NULL, string $object_name = NULL )
Driver
Loads a driver library
Parameters
$library
string
the name of the class
$params
mixed
the optional parameters
$object_name
string
an optional object name
public add_package_path ( string $path, boolean $view_cascade = TRUE )
Add Package Path
Prepends a parent path to the library, model, helper, and config path arrays
Parameters
$path
string
$view_cascade
boolean
public get_package_paths ( string $include_base = FALSE )
Get Package Paths
Return a list of all package paths, by default it will ignore BASEPATH.
Parameters
$include_base
string
public type remove_package_path ( type $path = '', boolean $remove_config_path = TRUE )
Remove Package Path
Remove a path from the library, model, and helper path arrays if it exists If no path is provided, the most recently added path is removed.
Parameters
$path
type
$remove_config_path
boolean
Returns
type
protected _ci_load ( array $_ci_data )
Loader
This function is used to load views and files. Variables are prefixed with _ci_ to avoid symbol collision with variables made available to view files
Parameters
$_ci_data
array
protected _ci_load_class ( string $class, mixed $params = NULL, string $object_name = NULL )
Load class
This function loads the requested class.
Parameters
$class
string
the item that is being loaded
$params
mixed
any additional parameters
$object_name
string
an optional object name
protected null _ci_init_class ( string $class, string $prefix = '', boolean $config = FALSE, string $object_name = NULL )
Instantiates a class
Parameters
$class
string
$prefix
string
$config
boolean
$object_name
string
an optional object name
Returns
null
protected array _ci_object_to_array ( object $object )
Object to Array
Takes an object as input and converts the class variables to array key/vals
Parameters
$object
object
Returns
array
protected boolean& _ci_get_component ( string $component )
Get a reference to a specific library or model
Parameters
$component
string
Returns
boolean
protected array _ci_prep_filename ( mixed $filename, string $extension )
Prep filename
This function preps the name of various items to make loading them more reliable.
Parameters
$filename
mixed
$extension
string
Returns
array
<table class="summary" id="properties">
<caption>Properties summary</caption>
<tr data-order="_ci_ob_level" id="$_ci_ob_level">
<td class="attributes"><code>
protected
integer
</code></td>
<td class="name">
$_ci_ob_level
<div class="description detailed">
Nesting level of the output buffering mechanism
</div>
</div></td>
</tr>
<tr data-order="_ci_view_paths" id="$_ci_view_paths">
<td class="attributes"><code>
protected
array
</code></td>
<td class="name">
$_ci_view_paths
array()
<div class="description detailed">
List of paths to load views from
</div>
</div></td>
</tr>
<tr data-order="_ci_library_paths" id="$_ci_library_paths">
<td class="attributes"><code>
protected
array
</code></td>
<td class="name">
$_ci_library_paths
array()
<div class="description detailed">
List of paths to load libraries from
</div>
</div></td>
</tr>
<tr data-order="_ci_model_paths" id="$_ci_model_paths">
<td class="attributes"><code>
protected
array
</code></td>
<td class="name">
$_ci_model_paths
array()
<div class="description detailed">
List of paths to load models from
</div>
</div></td>
</tr>
<tr data-order="_ci_helper_paths" id="$_ci_helper_paths">
<td class="attributes"><code>
protected
array
</code></td>
<td class="name">
$_ci_helper_paths
array()
<div class="description detailed">
List of paths to load helpers from
</div>
</div></td>
</tr>
<tr data-order="_base_classes" id="$_base_classes">
<td class="attributes"><code>
protected
array
</code></td>
<td class="name">
$_base_classes
array()
<div class="description detailed">
List of loaded base classes Set by the controller class
</div>
</div></td>
</tr>
<tr data-order="_ci_cached_vars" id="$_ci_cached_vars">
<td class="attributes"><code>
protected
array
</code></td>
<td class="name">
$_ci_cached_vars
array()
<div class="description detailed">
List of cached variables
</div>
</div></td>
</tr>
<tr data-order="_ci_classes" id="$_ci_classes">
<td class="attributes"><code>
protected
array
</code></td>
<td class="name">
$_ci_classes
array()
<div class="description detailed">
List of loaded classes
</div>
</div></td>
</tr>
<tr data-order="_ci_loaded_files" id="$_ci_loaded_files">
<td class="attributes"><code>
protected
array
</code></td>
<td class="name">
$_ci_loaded_files
array()
<div class="description detailed">
List of loaded files
</div>
</div></td>
</tr>
<tr data-order="_ci_models" id="$_ci_models">
<td class="attributes"><code>
protected
array
</code></td>
<td class="name">
$_ci_models
array()
<div class="description detailed">
List of loaded models
</div>
</div></td>
</tr>
<tr data-order="_ci_helpers" id="$_ci_helpers">
<td class="attributes"><code>
protected
array
</code></td>
<td class="name">
$_ci_helpers
array()
<div class="description detailed">
List of loaded helpers
</div>
</div></td>
</tr>
<tr data-order="_ci_varmap" id="$_ci_varmap">
<td class="attributes"><code>
protected
array
</code></td>
<td class="name">
$_ci_varmap
array('unit_test' => 'unit',
'user_agent' => 'agent')
API documentation generated by ApiGen 2.8.0
- application
- controlllers
- libraries
- models
- CodeIgniter
- Drivers
- Libraries
- None
- PHP
- Services
- Soundcloud
- About
- API_Controller
- Audioupload_lib
- Auth
- BaseFacebook
- Beats
- Beta
- CI_Benchmark
- CI_Cache
- CI_Cache_apc
- CI_Cache_dummy
- CI_Cache_file
- CI_Cache_memcached
- CI_Calendar
- CI_Cart
- CI_Config
- CI_Controller
- CI_DB_active_record
- CI_DB_Cache
- CI_DB_cubrid_driver
- CI_DB_cubrid_forge
- CI_DB_cubrid_result
- CI_DB_cubrid_utility
- CI_DB_driver
- CI_DB_forge
- CI_DB_mssql_driver
- CI_DB_mssql_forge
- CI_DB_mssql_result
- CI_DB_mssql_utility
- CI_DB_mysql_driver
- CI_DB_mysql_forge
- CI_DB_mysql_result
- CI_DB_mysql_utility
- CI_DB_mysqli_driver
- CI_DB_mysqli_forge
- CI_DB_mysqli_result
- CI_DB_mysqli_utility
- CI_DB_oci8_driver
- CI_DB_oci8_forge
- CI_DB_oci8_result
- CI_DB_oci8_utility
- CI_DB_odbc_driver
- CI_DB_odbc_forge
- CI_DB_odbc_result
- CI_DB_odbc_utility
- CI_DB_pdo_driver
- CI_DB_pdo_forge
- CI_DB_pdo_result
- CI_DB_pdo_utility
- CI_DB_postgre_driver
- CI_DB_postgre_forge
- CI_DB_postgre_result
- CI_DB_postgre_utility
- CI_DB_result
- CI_DB_sqlite_driver
- CI_DB_sqlite_forge
- CI_DB_sqlite_result
- CI_DB_sqlite_utility
- CI_DB_sqlsrv_driver
- CI_DB_sqlsrv_forge
- CI_DB_sqlsrv_result
- CI_DB_sqlsrv_utility
- CI_DB_utility
- CI_Driver
- CI_Driver_Library
- CI_Email
- CI_Encrypt
- CI_Exceptions
- CI_Form_validation
- CI_FTP
- CI_Hooks
- CI_Image_lib
- CI_Input
- CI_Javascript
- CI_Jquery
- CI_Lang
- CI_Loader
- CI_Log
- CI_Migration
- CI_Model
- CI_Output
- CI_Pagination
- CI_Parser
- CI_Profiler
- CI_Router
- CI_Security
- CI_Session
- CI_SHA1
- CI_Table
- CI_Trackback
- CI_Typography
- CI_Unit_test
- CI_Upload
- CI_URI
- CI_User_agent
- CI_Utf8
- CI_Xmlrpc
- CI_Xmlrpcs
- CI_Zip
- Comments_model
- CommercialContent_model
- Components
- Components_model
- Credits_model
- Dashboard
- DevTools
- Download
- Faq
- Featrequest_lib
- Feats
- Feats_model
- FormatterAbstract
- Framework_Controller
- Json_Response
- Local
- Main
- Notification_Formatter
- Notifications_model
- OAUTH_ALGORITHMS
- People
- Points_lib
- Projects
- Search
- SeenContent_model
- Services_Soundcloud
- Services_Soundcloud_Version
- Settings
- Showcases
- Tabs
- Template
- Tools
- UsageNotification
- Users
- Users_lib
- Users_model
- Videos
- vimeo_oauth
- Voices
- XML_RPC_Client
- XML_RPC_Message
- XML_RPC_Response
- XML_RPC_Values
- Exception
- FacebookApiException
- Services_Soundcloud_Invalid_Http_Response_Code_Exception
- Services_Soundcloud_Missing_Client_Id_Exception
- Services_Soundcloud_Unsupported_Audio_Format_Exception
- Services_Soundcloud_Unsupported_Response_Format_Exception
- _attributes_to_string
- _exception_handler
- _get_smiley_array
- _get_validation_object
- _list
- _parse_attributes
- _parse_form_attributes
- alternator
- anchor
- anchor_popup
- ascii_to_entities
- auto_link
- auto_typography
- base64_url_decode
- base_url
- bitly
- br
- build_auth_array
- build_auth_string
- byte_format
- c
- camelize
- canonical_timediff
- character_limiter
- ci_factory
- config_item
- convert_accented_characters
- create_captcha
- curl
- currencyToFloat
- current_url
- days_in_month
- DB
- delete_cookie
- delete_files
- directory_map
- do_hash
- doctype
- element
- elements
- ellipsize
- encode_php_tags
- entities_to_ascii
- entity_decode
- force_download
- form_button
- form_checkbox
- form_close
- form_dropdown
- form_error
- form_fieldset
- form_fieldset_close
- form_hidden
- form_input
- form_label
- form_multiselect
- form_open
- form_open_multipart
- form_password
- form_prep
- form_radio
- form_reset
- form_submit
- form_textarea
- form_upload
- get_auth_header
- get_categories_select
- get_clickable_smileys
- get_config
- get_cookie
- get_country_list
- get_dir_file_info
- get_file_info
- get_filenames
- get_instance
- get_language_select
- get_licences_select
- get_mime_by_extension
- gmt_to_local
- heading
- highlight_code
- highlight_phrase
- html_escape
- human_to_unix
- humanize
- img
- increment_string
- index_page
- is_false
- is_loaded
- is_php
- is_really_writable
- is_true
- js_insert_smiley
- lang
- link_tag
- load_class
- local_to_gmt
- log_message
- mailto
- mdate
- meta
- mysql_to_unix
- nbs
- nl2br_except_pre
- now
- octal_permissions
- ol
- parse_signed_request
- parse_smileys
- parseiOSversions
- plural
- prep_url
- quotes_to_entities
- random_element
- random_string
- read_file
- redirect
- reduce_double_slashes
- reduce_multiples
- remove_invisible_characters
- repeater
- safe_mailto
- sanitize_filename
- sec2min
- send_email
- set_checkbox
- set_cookie
- set_radio
- set_realpath
- set_select
- set_status_header
- set_value
- show_404
- show_comment
- show_error
- sign_hmac_sha1
- sign_rsa_sha1
- since
- singular
- site_url
- smiley_js
- standard_date
- strip_image_tags
- strip_quotes
- strip_slashes
- symbolic_permissions
- timespan
- timezone_menu
- timezones
- trim_slashes
- ul
- underscore
- unix_to_human
- uri_string
- url_title
- user
- user_favorite_list
- user_followed_list
- username
- valid_email
- validation_errors
- word_censor
- word_limiter
- word_wrap
- write_file
- xml_convert
- xss_clean