From e334c472fb4be44feec3a73402fc4a2b062cbfc0 Mon Sep 17 00:00:00 2001
From: admin Loader, as the name suggests, is used to load elements. These elements can be libraries (classes) View files,
+ Loader, as the name suggests, is used to load elements. These elements can be libraries (classes) View files,
Helpers, Plugins, or your own files. Note: This class is initialized automatically by the system so there is no need to do it manually. This function is used to load core classes. Where class_name is the name of the class you want to load.
+ This function is used to load core classes. Where class_name is the name of the class you want to load.
Note: We use the terms "class" and "library" interchangeably. For example, if you would like to send email with Code Igniter, the first step is to load the email class within your controller:Loader Class
-$this->load->library('class_name')
-
Parameters can be passed to the library via an array in the second parameter. +
Parameters can be passed to the library via an array in the second parameter. @@ -107,7 +107,7 @@ user guide it is recommended that you do since it shows you how this function is
The first parameter is required. It is the name of the view file you would like to load.
The second optional parameter can take -an associative array or an object as input, which it runs through the PHP extract function to +an associative array or an object as input, which it runs through the PHP extract function to convert to variables that can be used in your view files. Again, read the Views page to learn how this might be useful.
@@ -121,13 +121,13 @@ to your browser. Remember to assign it to a variable if you wan the data returnThis function lets you load the database class. The two parameters are optional. Please see the +
This function lets you load the database class. The two parameters are optional. Please see the database section for more info.
This function lets you enable scaffolding. Please see the +
This function lets you enable scaffolding. Please see the scaffolding section for more info.
@@ -135,9 +135,9 @@ to your browser. Remember to assign it to a variable if you wan the data returnThis function takes an associative array as input and generates variables using the PHP extract function. -This function produces the same result as using the second parameter of the $this->load->view() function above. The reason you might -want to use this function independently is if you would like to set some global variables in the constructor of your controller -and have them become available in any view file loaded from any function. You can have multiple calls to this function. The data get cached +This function produces the same result as using the second parameter of the $this->load->view() function above. The reason you might +want to use this function independently is if you would like to set some global variables in the constructor of your controller +and have them become available in any view file loaded from any function. You can have multiple calls to this function. The data get cached and merged into one array for conversion to variables.
@@ -150,7 +150,7 @@ and merged into one array for conversion to variables.This function loads plugins files, where file_name is the name of the file, without the _plugin.php extension.
This is a generic file loading function. Supply the filepath and name in the first parameter and it will open and read the file. +
This is a generic file loading function. Supply the filepath and name in the first parameter and it will open and read the file. By default the data is sent to your browser, just like a View file, but if you set the second parameter to true (boolean) it will instead return the data as a string.
-- cgit v1.2.3-24-g4f1b