From ee0a7f0083e9e3e2e667211acd3909e71aa1ec47 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 8 May 2008 13:59:27 +0000 Subject: Added a Reserved Names page to the userguide, and migrated reserved controller names into it. Added a Common Functions page to the userguide for globally available functions. --- user_guide/general/autoloader.html | 3 +- user_guide/general/common_functions.html | 90 ++++++++++++++++++ user_guide/general/controllers.html | 50 +--------- user_guide/general/reserved_names.html | 151 +++++++++++++++++++++++++++++++ user_guide/general/scaffolding.html | 8 +- user_guide/general/urls.html | 3 +- 6 files changed, 249 insertions(+), 56 deletions(-) create mode 100644 user_guide/general/common_functions.html create mode 100644 user_guide/general/reserved_names.html (limited to 'user_guide/general') diff --git a/user_guide/general/autoloader.html b/user_guide/general/autoloader.html index b75a71d19..3456fba2a 100644 --- a/user_guide/general/autoloader.html +++ b/user_guide/general/autoloader.html @@ -93,8 +93,7 @@ Previous Topic:  Hooks - Extending the Core    ·   Top of Page   ·   User Guide Home   ·   -Next Topic:  Scaffolding -

+Next Topic:  Common Functions

CodeIgniter  ·  Copyright © 2006-2008  ·  Ellislab, Inc.

diff --git a/user_guide/general/common_functions.html b/user_guide/general/common_functions.html new file mode 100644 index 000000000..e7cf9e068 --- /dev/null +++ b/user_guide/general/common_functions.html @@ -0,0 +1,90 @@ + + + + +Common Functions : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

CodeIgniter User Guide Version 1.6.2

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

Common Functions

+ +

CodeIgniter uses a few functions for its operation that are globally defined, and are available to you at any point. These do not require loading any libraries or helpers.

+

is_really_writable('path/to/file')

+

is_writable() returns TRUE on Windows servers when you really can't write to the file as the OS reports to PHP as FALSE only if the read-only attribute is marked. This function determines if a file is actually writable by attempting to write to it first. Generally only recommended on platforms where this information may be unreliable.

+if (is_really_writable('file.txt'))
+{
+      echo "I could write to this if I wanted to";
+}
+else
+{
+      echo "File is not writable";
+}
+

config_item('item_key')

+

The Config library is the preferred way of accessing configuration information, however config_item() can be used to retrieve single keys. See Config library documentation for more information.

+

show_error('message'), show_404('page'), log_message('level', 'message')

+

These are each outlined on the Error Handling page.

+
+ + + + + + + \ No newline at end of file diff --git a/user_guide/general/controllers.html b/user_guide/general/controllers.html index 2dac6e0d7..4c0c506af 100644 --- a/user_guide/general/controllers.html +++ b/user_guide/general/controllers.html @@ -359,50 +359,7 @@ Constructors can't return a value, but they can do some default work.

Since your controller classes will extend the main application controller you must be careful not to name your functions identically to the ones used by that class, otherwise your local functions -will override them. The following -is a list of reserved names. Do not name your controller functions any of these:

- - - -


If you are running PHP 4 there are some additional reserved names. These ONLY apply if you are running PHP 4.

- - - - - - - +will override them. See Reserved Names for a full list.

That's it!

@@ -416,12 +373,11 @@ is a list of reserved names. Do not name your controller functions any of these diff --git a/user_guide/general/reserved_names.html b/user_guide/general/reserved_names.html new file mode 100644 index 000000000..60bdec2fc --- /dev/null +++ b/user_guide/general/reserved_names.html @@ -0,0 +1,151 @@ + + + + +Reserved Names : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

CodeIgniter User Guide Version 1.6.2

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

Reserved Names

+ +

In order to help out, CodeIgniter uses a series of functions and names in its operation. Because of this, some names cannot be used by a developer. Following is a list of reserved names that cannot be used.

+

Controller names

+

Since your controller classes will extend the main application controller you +must be careful not to name your functions identically to the ones used by that class, otherwise your local functions +will override them. The following +is a list of reserved names. Do not name your controller functions any of these:

+ +


+ If you are running PHP 4 there are some additional reserved names. These ONLY apply if you are running PHP 4.

+ +

Functions

+ +

Variables

+ +

Constants

+ +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/general/scaffolding.html b/user_guide/general/scaffolding.html index 764e3b4cf..7dc66d1d8 100644 --- a/user_guide/general/scaffolding.html +++ b/user_guide/general/scaffolding.html @@ -104,7 +104,7 @@ class Blog extends Controller {
       function Blog()
       {
            parent::Controller();

-            $this->load->scaffolding('table_name');
+            $this->load->scaffolding('table_name');
       }
}
?> @@ -135,12 +135,10 @@ database functions.

diff --git a/user_guide/general/urls.html b/user_guide/general/urls.html index 9902083fa..8ba46e3d8 100644 --- a/user_guide/general/urls.html +++ b/user_guide/general/urls.html @@ -145,8 +145,7 @@ Previous Topic:  Getting Started    ·   Top of Page   ·   User Guide Home   ·   -Next Topic:  Controllers -

+Next Topic:  Reserved Names

CodeIgniter  ·  Copyright © 2006-2008  ·  Ellislab, Inc.

-- cgit v1.2.3-24-g4f1b