From b0dd10f8171945e0c1f3527dd1e9d18b043e01a7 Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 25 Aug 2006 17:25:49 +0000 Subject: Initial Import --- user_guide/general/scripts.html | 115 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 user_guide/general/scripts.html (limited to 'user_guide/general/scripts.html') diff --git a/user_guide/general/scripts.html b/user_guide/general/scripts.html new file mode 100644 index 000000000..d0b5d26f6 --- /dev/null +++ b/user_guide/general/scripts.html @@ -0,0 +1,115 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ +

The Scripts Folder

+ +

Inside the application directory you'll find a folder called scripts. Its purpose is +to give you a place to store your own script includes or classes.

+ +

Loading a Script

+ +

Your scripts can be loaded in your controllers or views using the following function:

+ +$this->load->script('name'); + +

Where name is the file name of the script, without the .php file extension.

+ +

For example, to load a file called utilities.php you would do this:

+ +$this->load->script('utilities'); + +

If you load a script in your controller constructor it will be available +automatically in any function, or you can load it in a specific function that needs it.

+ +

Note: The Script loading function above does not return a value, so don't try to assign it to a variable. Just use it as shown.

+ +

Loading Multiple Scripts

+ +

If you need to load more than one script you can specify them in an array, like this:

+ +$this->load->script( array('script1', 'script2', 'script3') ); + +

Auto-loading Scripts

+ +

If you find that you need a particular script globally throughout your application, you can tell Code Igniter to auto-load it +during system initialization. This is done by opening the application/config/autoload.php file and adding +the script to the autoload array.

+ + + +
+ + + + + + + \ No newline at end of file -- cgit v1.2.3-24-g4f1b