Skip to content

Commit

Permalink
Fix some user guide style
Browse files Browse the repository at this point in the history
  • Loading branch information
purwandi committed Oct 7, 2011
1 parent 5ebf9d1 commit 89f6f1a
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 48 deletions.
37 changes: 18 additions & 19 deletions user_guide_src/source/general/helpers.rst
Expand Up @@ -3,10 +3,10 @@ Helper Functions
################

Helpers, as the name suggests, help you with tasks. Each helper file is
simply a collection of functions in a particular category. There are URL
Helpers, that assist in creating links, there are Form Helpers that help
you create form elements, Text Helpers perform various text formatting
routines, Cookie Helpers set and read cookies, File Helpers help you
simply a collection of functions in a particular category. There are **URL
Helpers**, that assist in creating links, there are Form Helpers that help
you create form elements, **Text Helpers** perform various text formatting
routines, **Cookie Helpers** set and read cookies, File Helpers help you
deal with files, etc.

Unlike most other systems in CodeIgniter, Helpers are not written in an
Expand All @@ -19,9 +19,9 @@ using a Helper is to load it. Once loaded, it becomes globally available
in your :doc:`controller <../general/controllers>` and
:doc:`views <../general/views>`.

Helpers are typically stored in your system/helpers, or
application/helpers directory. CodeIgniter will look first in your
application/helpers directory. If the directory does not exist or the
Helpers are typically stored in your **system/helpers**, or
**application/helpers directory**. CodeIgniter will look first in your
**application/helpers directory**. If the directory does not exist or the
specified helper is not located there CI will instead look in your
global system/helpers folder.

Expand All @@ -32,11 +32,11 @@ Loading a helper file is quite simple using the following function::

$this->load->helper('name');

Where name is the file name of the helper, without the .php file
Where **name** is the file name of the helper, without the .php file
extension or the "helper" part.

For example, to load the URL Helper file, which is named
url_helper.php, you would do this::
For example, to load the **URL Helper** file, which is named
**url_helper.php**, you would do this::

$this->load->helper('url');

Expand All @@ -63,9 +63,8 @@ Auto-loading Helpers

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

Using a Helper
==============
Expand All @@ -84,8 +83,8 @@ URI to the controller/function you wish to link to.
"Extending" Helpers
===================

To "extend" Helpers, create a file in your application/helpers/ folder
with an identical name to the existing Helper, but prefixed with MY\_
To "extend" Helpers, create a file in your **application/helpers/** folder
with an identical name to the existing Helper, but prefixed with **MY\_**
(this item is configurable. See below.).

If all you need to do is add some functionality to an existing helper -
Expand All @@ -98,8 +97,8 @@ sense. Under the hood, this gives you the ability to add to the
functions a Helper provides, or to modify how the native Helper
functions operate.

For example, to extend the native Array Helper you'll create a file
named application/helpers/MY_array_helper.php, and add or override
For example, to extend the native **Array Helper** you'll create a file
named **application/helpers/MY_array_helper.php**, and add or override
functions::

// any_in_array() is not in the Array Helper, so it defines a new function
Expand Down Expand Up @@ -130,11 +129,11 @@ Setting Your Own Prefix

The filename prefix for "extending" Helpers is the same used to extend
libraries and Core classes. To set your own prefix, open your
application/config/config.php file and look for this item::
**application/config/config.php** file and look for this item::

$config['subclass_prefix'] = 'MY_';

Please note that all native CodeIgniter libraries are prefixed with CI\_
Please note that all native CodeIgniter libraries are prefixed with **CI\_**
so DO NOT use that as your prefix.

Now What?
Expand Down
35 changes: 34 additions & 1 deletion user_guide_src/source/general/index.rst
@@ -1,6 +1,39 @@
##################
General
##################


- :doc:`CodeIgniter URLs <urls>`
- :doc:`Controllers <controllers>`
- :doc:`Reserved Names <reserved_names>`
- :doc:`Views <views>`
- :doc:`Models <models>`
- :doc:`Helpers <helpers>`
- :doc:`Using CodeIgniter Libraries <libraries>`
- :doc:`Creating Your Own Libraries <creating_libraries>`
- :doc:`Using CodeIgniter Drivers <drivers>`
- :doc:`Creating Your Own Drivers <creating_drivers>`
- :doc:`Creating Core Classes <core_classes>`
- :doc:`Creating Ancillary Classes <ancillary_classes>`
- :doc:`Hooks - Extending the Core <hooks>`
- :doc:`Auto-loading Resources <autoloader>`
- :doc:`Common Function <common_functions>`
- :doc:`URI Routing <routing>`
- :doc:`Error Handling <errors>`
- :doc:`Caching <caching>`
- :doc:`Profiling Your Application <profiling>`
- :doc:`Running via the CLI <cli>`
- :doc:`Managing Applications <managing_apps>`
- :doc:`Handling Multiple Environments <environments>`
- :doc:`Alternative PHP Syntax <alternative_php>`
- :doc:`Security <security>`
- :doc:`PHP Style Guide <styleguide>`
- :doc:`Server Requirements <requirements>`
- :doc:`Credits <credits>`

.. toctree::
:glob:
:hidden:
:titlesonly:
:hidden:

*
6 changes: 3 additions & 3 deletions user_guide_src/source/general/models.rst
Expand Up @@ -65,7 +65,7 @@ model class might look like::
Anatomy of a Model
==================

Model classes are stored in your application/models/ folder. They can be
Model classes are stored in your **application/models/ folder**. They can be
nested within sub-folders if you want this type of organization.

The basic prototype for a model class is this::
Expand All @@ -78,7 +78,7 @@ The basic prototype for a model class is this::
}
}

Where Model_name is the name of your class. Class names **must** have
Where **Model_name** is the name of your class. Class names **must** have
the first letter capitalized with the rest of the name lowercase. Make
sure your class extends the base Model class.

Expand Down Expand Up @@ -148,7 +148,7 @@ Auto-loading Models
If you find that you need a particular model globally throughout your
application, you can tell CodeIgniter to auto-load it during system
initialization. This is done by opening the
application/config/autoload.php file and adding the model to the
**application/config/autoload.php** file and adding the model to the
autoload array.

Connecting to your Database
Expand Down
4 changes: 2 additions & 2 deletions user_guide_src/source/general/security.rst
Expand Up @@ -35,8 +35,8 @@ error reporting by setting the internal error_reporting flag to a value
of 0. This disables native PHP errors from being rendered as output,
which may potentially contain sensitive information.

Setting CodeIgniter's ENVIRONMENT constant in index.php to a value of
'production' will turn off these errors. In development mode, it is
Setting CodeIgniter's **ENVIRONMENT** constant in index.php to a value of
**\'production\'** will turn off these errors. In development mode, it is
recommended that a value of 'development' is used. More information
about differentiating between environments can be found on the :doc:`Handling
Environments <environments>` page.
Expand Down
37 changes: 15 additions & 22 deletions user_guide_src/source/libraries/calendar.rst
Expand Up @@ -86,28 +86,21 @@ The above code would start the calendar on saturday, use the "long"
month heading, and the "short" day names. More information regarding
preferences below.

+-----------------------+-----------+-----------------------------------------------+-------------------------------------------------------------------+
| Preference | Default | Options | Description |
+=======================+===========+===============================================+===================================================================+
| **template** | None | None | A string containing your calendar template. |
| | | | See the template section below. |
+-----------------------+-----------+-----------------------------------------------+-------------------------------------------------------------------+
| **local_time** | time() | None | A Unix timestamp corresponding to the current time. |
+-----------------------+-----------+-----------------------------------------------+-------------------------------------------------------------------+
| **start_day** | sunday | Any week day (sunday, monday, tuesday, etc.) | Sets the day of the week the calendar should start on. |
+-----------------------+-----------+-----------------------------------------------+-------------------------------------------------------------------+
| **month_type** | long | long, short | Determines what version of the month name to use in the header. |
| | | | long = January, short = Jan. |
+-----------------------+-----------+-----------------------------------------------+-------------------------------------------------------------------+
| **day_type** | abr | long, short, abr | Determines what version of the weekday names to use in |
| | | | the column headers. |
| | | | long = Sunday, short = Sun, abr = Su. |
+-----------------------+-----------+-----------------------------------------------+-------------------------------------------------------------------+
| **show_next_prev** | FALSE | TRUE/FALSE (boolean) | Determines whether to display links allowing you to toggle |
| | | | to next/previous months. See information on this feature below. |
+-----------------------+-----------+-----------------------------------------------+-------------------------------------------------------------------+
| **next_prev_url** | None | A URL | Sets the basepath used in the next/previous calendar links. |
+-----------------------+-----------+-----------------------------------------------+-------------------------------------------------------------------+
====================== =========== =============================================== ===================================================================
Preference Default Options Description
====================== =========== =============================================== ===================================================================
**template** None None A string containing your calendar template.
See the template section below.
**local_time** time() None A Unix timestamp corresponding to the current time.
**start_day** sunday Any week day (sunday, monday, tuesday, etc.) Sets the day of the week the calendar should start on.
**month_type** long long, short Determines what version of the month name to use in the header.
long = January, short = Jan.
**day_type** abr long, short, abr Determines what version of the weekday names to use in
the column headers. long = Sunday, short = Sun, abr = Su.
**show_next_prev** FALSE TRUE/FALSE (boolean) Determines whether to display links allowing you to toggle
to next/previous months. See information on this feature below.
**next_prev_url** None A URL Sets the basepath used in the next/previous calendar links.
====================== =========== =============================================== ===================================================================


Showing Next/Previous Month Links
Expand Down
1 change: 0 additions & 1 deletion user_guide_src/source/libraries/form_validation.rst
Expand Up @@ -823,7 +823,6 @@ Rule Reference
The following is a list of all the native rules that are available to
use:

.. table::
======================= ========== ============================================================================================= =======================
Rule Parameter Description Example
======================= ========== ============================================================================================= =======================
Expand Down

0 comments on commit 89f6f1a

Please sign in to comment.