summaryrefslogtreecommitdiffstats
path: root/user_guide_src/source/helpers
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2014-02-07 22:31:49 +0100
committerAndrey Andreev <narf@devilix.net>2014-02-07 22:31:49 +0100
commit3de130c2da3b93a3404f264e92d7b65354de3548 (patch)
tree368b1847fffe7af21c5fbc3fa7925212b678e60b /user_guide_src/source/helpers
parent1e584208e420d1d864de2bc686d437ecdf0ce064 (diff)
[ci skip] Add return types to helper docs (+ some other formatting)
Diffstat (limited to 'user_guide_src/source/helpers')
-rw-r--r--user_guide_src/source/helpers/array_helper.rst5
-rw-r--r--user_guide_src/source/helpers/captcha_helper.rst1
-rw-r--r--user_guide_src/source/helpers/cookie_helper.rst35
-rw-r--r--user_guide_src/source/helpers/date_helper.rst181
-rw-r--r--user_guide_src/source/helpers/directory_helper.rst10
-rw-r--r--user_guide_src/source/helpers/download_helper.rst2
-rw-r--r--user_guide_src/source/helpers/email_helper.rst11
-rw-r--r--user_guide_src/source/helpers/file_helper.rst41
-rw-r--r--user_guide_src/source/helpers/form_helper.rst82
-rw-r--r--user_guide_src/source/helpers/html_helper.rst97
-rw-r--r--user_guide_src/source/helpers/inflector_helper.rst23
-rw-r--r--user_guide_src/source/helpers/language_helper.rst21
-rw-r--r--user_guide_src/source/helpers/number_helper.rst5
-rw-r--r--user_guide_src/source/helpers/path_helper.rst3
-rw-r--r--user_guide_src/source/helpers/security_helper.rst20
-rw-r--r--user_guide_src/source/helpers/smiley_helper.rst12
-rw-r--r--user_guide_src/source/helpers/string_helper.rst39
-rw-r--r--user_guide_src/source/helpers/text_helper.rst40
-rw-r--r--user_guide_src/source/helpers/typography_helper.rst10
-rw-r--r--user_guide_src/source/helpers/url_helper.rst44
-rw-r--r--user_guide_src/source/helpers/xml_helper.rst5
21 files changed, 361 insertions, 326 deletions
diff --git a/user_guide_src/source/helpers/array_helper.rst b/user_guide_src/source/helpers/array_helper.rst
index 20f5864a6..4805f581a 100644
--- a/user_guide_src/source/helpers/array_helper.rst
+++ b/user_guide_src/source/helpers/array_helper.rst
@@ -32,6 +32,7 @@ The following functions are available:
:param array $array: Input array
:param bool $default: What to return if the array isn't valid
:returns: NULL on failure or the array item.
+ :rtype: mixed
Lets you fetch an item from an array. The function tests whether the
array index is set and whether it has a value. If a value exists it is
@@ -56,6 +57,7 @@ The following functions are available:
:param array $array: Input array
:param bool $default: What to return if the array isn't valid
:returns: NULL on failure or the array item.
+ :rtype: mixed
Lets you fetch a number of items from an array. The function tests
whether each of the array indices is set. If an index does not exist it
@@ -112,7 +114,8 @@ The following functions are available:
.. function:: random_element($array)
:param array $array: Input array
- :returns: string (a random element from the array)
+ :returns: A random element from the array
+ :rtype: mixed
Takes an array as input and returns a random element from it.
diff --git a/user_guide_src/source/helpers/captcha_helper.rst b/user_guide_src/source/helpers/captcha_helper.rst
index 13cf92a19..d83490b8e 100644
--- a/user_guide_src/source/helpers/captcha_helper.rst
+++ b/user_guide_src/source/helpers/captcha_helper.rst
@@ -135,6 +135,7 @@ The following functions are available:
:param string $img_url: URL to the CAPTCHA image folder
:param string $font_path: Server path to font
:returns: array('word' => $word, 'time' => $now, 'image' => $img)
+ :rtype: array
Takes an array of information to generate the CAPTCHA as input and
creates the image to your specifications, returning an array of
diff --git a/user_guide_src/source/helpers/cookie_helper.rst b/user_guide_src/source/helpers/cookie_helper.rst
index 3b594170d..22fd0f77f 100644
--- a/user_guide_src/source/helpers/cookie_helper.rst
+++ b/user_guide_src/source/helpers/cookie_helper.rst
@@ -27,15 +27,15 @@ The following functions are available:
.. function:: set_cookie($name[, $value = ''[, $expire = ''[, $domain = ''[, $path = '/'[, $prefix = ''[, $secure = FALSE[, $httponly = FALSE]]]]]]]])
- :param mixed $name: Cookie name *or* associative array of all of the parameters available to this function
- :param string $value: Cookie value
- :param int $expire: Number of seconds until expiration
- :param string $domain: Cookie domain (usually: .yourdomain.com)
- :param string $path: Cookie path
- :param string $prefix: Cookie name prefix
- :param bool $secure: Whether to only send the cookie through HTTPS
- :param bool $httponly: Whether to hide the cookie from JavaScript
- :returns: void
+ :param mixed $name: Cookie name *or* associative array of all of the parameters available to this function
+ :param string $value: Cookie value
+ :param int $expire: Number of seconds until expiration
+ :param string $domain: Cookie domain (usually: .yourdomain.com)
+ :param string $path: Cookie path
+ :param string $prefix: Cookie name prefix
+ :param bool $secure: Whether to only send the cookie through HTTPS
+ :param bool $httponly: Whether to hide the cookie from JavaScript
+ :rtype: void
This helper function gives you view file friendly syntax to set browser
cookies. Refer to the :doc:`Input Library <../libraries/input>` for a
@@ -45,9 +45,10 @@ The following functions are available:
.. function:: get_cookie($index[, $xss_clean = NULL]])
- :param string $index: Cookie name
- :param bool $xss_clean: Whether to apply XSS filtering to the returned value
- :returns: mixed
+ :param string $index: Cookie name
+ :param bool $xss_clean: Whether to apply XSS filtering to the returned value
+ :returns: The cookie value or NULL if not found
+ :rtype: mixed
This helper function gives you view file friendly syntax to get browser
cookies. Refer to the :doc:`Input Library <../libraries/input>` for a
@@ -56,11 +57,11 @@ The following functions are available:
.. function:: delete_cookie($name[, $domain = ''[, $path = '/'[, $prefix = '']]]])
- :param string $name: Cookie name
- :param string $domain: Cookie domain (usually: .yourdomain.com)
- :param string $path: Cookie path
- :param string $prefix: Cookie name prefix
- :returns: void
+ :param string $name: Cookie name
+ :param string $domain: Cookie domain (usually: .yourdomain.com)
+ :param string $path: Cookie path
+ :param string $prefix: Cookie name prefix
+ :rtype: void
Lets you delete a cookie. Unless you've set a custom path or other
values, only the name of the cookie is needed.
diff --git a/user_guide_src/source/helpers/date_helper.rst b/user_guide_src/source/helpers/date_helper.rst
index e7598df14..39a9cb325 100644
--- a/user_guide_src/source/helpers/date_helper.rst
+++ b/user_guide_src/source/helpers/date_helper.rst
@@ -27,7 +27,8 @@ The following functions are available:
.. function:: now([$timezone = NULL])
:param string $timezone: Timezone
- :returns: int
+ :returns: UNIX timestamp
+ :rtype: int
Returns the current time as a UNIX timestamp, referenced either to your server's
local time or any PHP suported timezone, based on the "time reference" setting
@@ -35,7 +36,6 @@ The following functions are available:
any other PHP supported timezone (which you'll typically do if you run a site
that lets each user set their own timezone settings) there is no benefit to using
this function over PHP's ``time()`` function.
-
::
echo now('Australia/Victoria');
@@ -43,12 +43,12 @@ The following functions are available:
If a timezone is not provided, it will return ``time()`` based on the
**time_reference** setting.
-
.. function:: mdate([$datestr = ''[, $time = '']])
- :param string $datestr: Date string
- :param int $time: UNIX timestamp
- :returns: int
+ :param string $datestr: Date string
+ :param int $time: UNIX timestamp
+ :returns: MySQL-formatted date
+ :rtype: string
This function is identical to PHP's `date() <http://www.php.net/date>`_
function, except that it lets you use MySQL style date codes, where each
@@ -67,12 +67,12 @@ The following functions are available:
If a timestamp is not included in the second parameter the current time
will be used.
-
.. function:: standard_date([$fmt = 'DATE_RFC822'[, $time = NULL]])
:param string $fmt: Date format
- :param int $time: UNIX timestamp
- :returns: string
+ :param int $time: UNIX timestamp
+ :returns: Formatted date or FALSE on invalid format
+ :rtype: string
Lets you generate a date string in one of several standardized formats.
@@ -92,25 +92,25 @@ The following functions are available:
**Supported formats:**
=============== ======================= ======================================
- Constant Description Example
+ Constant Description Example
=============== ======================= ======================================
- DATE_ATOM Atom 2005-08-15T16:13:03+0000
- DATE_COOKIE HTTP Cookies Sun, 14 Aug 2005 16:13:03 UTC
- DATE_ISO8601 ISO-8601 2005-08-14T16:13:03+00:00
- DATE_RFC822 RFC 822 Sun, 14 Aug 05 16:13:03 UTC
- DATE_RFC850 RFC 850 Sunday, 14-Aug-05 16:13:03 UTC
- DATE_RFC1036 RFC 1036 Sunday, 14-Aug-05 16:13:03 UTC
- DATE_RFC1123 RFC 1123 Sun, 14 Aug 2005 16:13:03 UTC
- DATE_RFC2822 RFC 2822 Sun, 14 Aug 2005 16:13:03 +0000
- DATE_RSS RSS Sun, 14 Aug 2005 16:13:03 UTC
- DATE_W3C W3C 2005-08-14T16:13:03+0000
+ DATE_ATOM Atom 2005-08-15T16:13:03+0000
+ DATE_COOKIE HTTP Cookies Sun, 14 Aug 2005 16:13:03 UTC
+ DATE_ISO8601 ISO-8601 2005-08-14T16:13:03+00:00
+ DATE_RFC822 RFC 822 Sun, 14 Aug 05 16:13:03 UTC
+ DATE_RFC850 RFC 850 Sunday, 14-Aug-05 16:13:03 UTC
+ DATE_RFC1036 RFC 1036 Sunday, 14-Aug-05 16:13:03 UTC
+ DATE_RFC1123 RFC 1123 Sun, 14 Aug 2005 16:13:03 UTC
+ DATE_RFC2822 RFC 2822 Sun, 14 Aug 2005 16:13:03 +0000
+ DATE_RSS RSS Sun, 14 Aug 2005 16:13:03 UTC
+ DATE_W3C W3C 2005-08-14T16:13:03+0000
=============== ======================= ======================================
-
.. function:: local_to_gmt([$time = ''])
:param int $time: UNIX timestamp
- :returns: string
+ :returns: UNIX timestamp
+ :rtype: int
Takes a UNIX timestamp as input and returns it as GMT.
@@ -118,13 +118,13 @@ The following functions are available:
$gmt = local_to_gmt(time());
-
.. function:: gmt_to_local([$time = ''[, $timezone = 'UTC'[, $dst = FALSE]]])
- :param int $time: UNIX timestamp
+ :param int $time: UNIX timestamp
:param string $timezone: Timezone
- :param bool $dst: Whether DST is active
- :returns: int
+ :param bool $dst: Whether DST is active
+ :returns: UNIX timestamp
+ :rtype: int
Takes a UNIX timestamp (referenced to GMT) as input, and converts it to
a localized timestamp based on the timezone and Daylight Saving Time
@@ -140,11 +140,11 @@ The following functions are available:
.. note:: For a list of timezones see the reference at the bottom of this page.
-
.. function:: mysql_to_unix([$time = ''])
- :param int $time: UNIX timestamp
- :returns: int
+ :param string $time: MySQL timestamp
+ :returns: UNIX timestamp
+ :rtype: int
Takes a MySQL Timestamp as input and returns it as a UNIX timestamp.
@@ -152,13 +152,13 @@ The following functions are available:
$unix = mysql_to_unix('20061124092345');
-
.. function:: unix_to_human([$time = ''[, $seconds = FALSE[, $fmt = 'us']]])
:param int $time: UNIX timestamp
:param bool $seconds: Whether to show seconds
:param string $fmt: format (us or euro)
- :returns: integer
+ :returns: Formatted date
+ :rtype: string
Takes a UNIX timestamp as input and returns it in a human readable
format with this prototype::
@@ -179,11 +179,11 @@ The following functions are available:
echo unix_to_human($now, TRUE, 'us'); // U.S. time with seconds
echo unix_to_human($now, TRUE, 'eu'); // Euro time with seconds
-
.. function:: human_to_unix([$datestr = ''])
- :param int $datestr: Date string
- :returns: int UNIX timestamp or FALSE on failure
+ :param int $datestr: Date string
+ :returns: UNIX timestamp or FALSE on failure
+ :rtype: int
The opposite of the :func:`unix_to_time()` function. Takes a "human"
time as input and returns it as a UNIX timestamp. This is useful if you
@@ -196,12 +196,12 @@ The following functions are available:
$human = unix_to_human($now);
$unix = human_to_unix($human);
-
.. function:: nice_date([$bad_date = ''[, $format = FALSE]])
:param int $bad_date: The terribly formatted date-like string
:param string $format: Date format to return (same as PHP's ``date()`` function)
- :returns: string
+ :returns: Formatted date
+ :rtype: string
This function can take a number poorly-formed date formats and convert
them into something useful. It also accepts well-formed dates.
@@ -220,13 +220,13 @@ The following functions are available:
// Should Produce: 2001-09-11
$better_date = nice_date($bad_date, 'Y-m-d');
-
.. function:: timespan([$seconds = 1[, $time = ''[, $units = '']]])
:param int $seconds: Number of seconds
:param string $time: UNIX timestamp
:param int $units: Number of time units to display
- :returns: string
+ :returns: Formatted time difference
+ :rtype: string
Formats a UNIX timestamp so that is appears similar to this::
@@ -252,12 +252,12 @@ The following functions are available:
.. note:: The text generated by this function is found in the following language
file: `language/<your_lang>/date_lang.php`
-
.. function:: days_in_month([$month = 0[, $year = '']])
:param int $month: a numeric month
:param int $year: a numeric year
- :returns: int
+ :returns: Count of days in the specified month
+ :rtype: int
Returns the number of days in a given month/year. Takes leap years into
account.
@@ -268,14 +268,14 @@ The following functions are available:
If the second parameter is empty, the current year will be used.
-
.. function:: date_range([$unix_start = ''[, $mixed = ''[, $is_unix = TRUE[, $format = 'Y-m-d']]]])
:param int $unix_start: UNIX timestamp of the range start date
:param int $mixed: UNIX timestamp of the range end date or interval in days
:param bool $is_unix: set to FALSE if $mixed is not a timestamp
:param string $format: Output date format, same as in ``date()``
- :returns: array
+ :returns: An array of dates
+ :rtype: array
Returns a list of dates within a specified period.
@@ -288,11 +288,11 @@ The following functions are available:
echo $date."\n";
}
-
.. function:: timezones([$tz = ''])
- :param string $tz: a numeric timezone
- :returns: string
+ :param string $tz: A numeric timezone
+ :returns: Hour difference from UTC
+ :rtype: int
Takes a timezone reference (for a list of valid timezones, see the
"Timezone Reference" below) and returns the number of hours offset from
@@ -305,14 +305,14 @@ The following functions are available:
This function is useful when used with :func:`timezone_menu()`.
-
.. function:: timezone_menu([$default = 'UTC'[, $class = ''[, $name = 'timezones'[, $attributes = '']]]])
:param string $default: Timezone
:param string $class: Class name
:param string $name: Menu name
:param mixed $attributes: HTML attributes
- :returns: string
+ :returns: HTML drop down menu with time zones
+ :rtype: string
Generates a pull-down menu of timezones, like this one:
@@ -381,7 +381,6 @@ The following functions are available:
.. note:: The text contained in the menu is found in the following
language file: `language/<your_lang>/date_lang.php`
-
Timezone Reference
==================
@@ -389,47 +388,47 @@ The following table indicates each timezone and its location.
Note some of the location lists have been abridged for clarity and formatting.
-=========== =====================================================================
-Time Zone Location
-=========== =====================================================================
-UM12 (UTC - 12:00) Baker/Howland Island
-UM11 (UTC - 11:00) Samoa Time Zone, Niue
-UM10 (UTC - 10:00) Hawaii-Aleutian Standard Time, Cook Islands
-UM95 (UTC - 09:30) Marquesas Islands
-UM9 (UTC - 09:00) Alaska Standard Time, Gambier Islands
-UM8 (UTC - 08:00) Pacific Standard Time, Clipperton Island
-UM7 (UTC - 11:00) Mountain Standard Time
-UM6 (UTC - 06:00) Central Standard Time
-UM5 (UTC - 05:00) Eastern Standard Time, Western Caribbean
-UM45 (UTC - 04:30) Venezuelan Standard Time
-UM4 (UTC - 04:00) Atlantic Standard Time, Eastern Caribbean
-UM35 (UTC - 03:30) Newfoundland Standard Time
-UM3 (UTC - 03:00) Argentina, Brazil, French Guiana, Uruguay
-UM2 (UTC - 02:00) South Georgia/South Sandwich Islands
-UM1 (UTC -1:00) Azores, Cape Verde Islands
-UTC (UTC) Greenwich Mean Time, Western European Time
-UP1 (UTC +1:00) Central European Time, West Africa Time
-UP2 (UTC +2:00) Central Africa Time, Eastern European Time
-UP3 (UTC +3:00) Moscow Time, East Africa Time
-UP35 (UTC +3:30) Iran Standard Time
-UP4 (UTC +4:00) Azerbaijan Standard Time, Samara Time
-UP45 (UTC +4:30) Afghanistan
-UP5 (UTC +5:00) Pakistan Standard Time, Yekaterinburg Time
-UP55 (UTC +5:30) Indian Standard Time, Sri Lanka Time
-UP575 (UTC +5:45) Nepal Time
-UP6 (UTC +6:00) Bangladesh Standard Time, Bhutan Time, Omsk Time
-UP65 (UTC +6:30) Cocos Islands, Myanmar
-UP7 (UTC +7:00) Krasnoyarsk Time, Cambodia, Laos, Thailand, Vietnam
-UP8 (UTC +8:00) Australian Western Standard Time, Beijing Time
-UP875 (UTC +8:45) Australian Central Western Standard Time
-UP9 (UTC +9:00) Japan Standard Time, Korea Standard Time, Yakutsk
-UP95 (UTC +9:30) Australian Central Standard Time
-UP10 (UTC +10:00) Australian Eastern Standard Time, Vladivostok Time
-UP105 (UTC +10:30) Lord Howe Island
-UP11 (UTC +11:00) Magadan Time, Solomon Islands, Vanuatu
-UP115 (UTC +11:30) Norfolk Island
-UP12 (UTC +12:00) Fiji, Gilbert Islands, Kamchatka, New Zealand
-UP1275 (UTC +12:45) Chatham Islands Standard Time
-UP13 (UTC +13:00) Phoenix Islands Time, Tonga
-UP14 (UTC +14:00) Line Islands
+=========== =====================================================================
+Time Zone Location
+=========== =====================================================================
+UM12 (UTC - 12:00) Baker/Howland Island
+UM11 (UTC - 11:00) Samoa Time Zone, Niue
+UM10 (UTC - 10:00) Hawaii-Aleutian Standard Time, Cook Islands
+UM95 (UTC - 09:30) Marquesas Islands
+UM9 (UTC - 09:00) Alaska Standard Time, Gambier Islands
+UM8 (UTC - 08:00) Pacific Standard Time, Clipperton Island
+UM7 (UTC - 11:00) Mountain Standard Time
+UM6 (UTC - 06:00) Central Standard Time
+UM5 (UTC - 05:00) Eastern Standard Time, Western Caribbean
+UM45 (UTC - 04:30) Venezuelan Standard Time
+UM4 (UTC - 04:00) Atlantic Standard Time, Eastern Caribbean
+UM35 (UTC - 03:30) Newfoundland Standard Time
+UM3 (UTC - 03:00) Argentina, Brazil, French Guiana, Uruguay
+UM2 (UTC - 02:00) South Georgia/South Sandwich Islands
+UM1 (UTC -1:00) Azores, Cape Verde Islands
+UTC (UTC) Greenwich Mean Time, Western European Time
+UP1 (UTC +1:00) Central European Time, West Africa Time
+UP2 (UTC +2:00) Central Africa Time, Eastern European Time
+UP3 (UTC +3:00) Moscow Time, East Africa Time
+UP35 (UTC +3:30) Iran Standard Time
+UP4 (UTC +4:00) Azerbaijan Standard Time, Samara Time
+UP45 (UTC +4:30) Afghanistan
+UP5 (UTC +5:00) Pakistan Standard Time, Yekaterinburg Time
+UP55 (UTC +5:30) Indian Standard Time, Sri Lanka Time
+UP575 (UTC +5:45) Nepal Time
+UP6 (UTC +6:00) Bangladesh Standard Time, Bhutan Time, Omsk Time
+UP65 (UTC +6:30) Cocos Islands, Myanmar
+UP7 (UTC +7:00) Krasnoyarsk Time, Cambodia, Laos, Thailand, Vietnam
+UP8 (UTC +8:00) Australian Western Standard Time, Beijing Time
+UP875 (UTC +8:45) Australian Central Western Standard Time
+UP9 (UTC +9:00) Japan Standard Time, Korea Standard Time, Yakutsk
+UP95 (UTC +9:30) Australian Central Standard Time
+UP10 (UTC +10:00) Australian Eastern Standard Time, Vladivostok Time
+UP105 (UTC +10:30) Lord Howe Island
+UP11 (UTC +11:00) Magadan Time, Solomon Islands, Vanuatu
+UP115 (UTC +11:30) Norfolk Island
+UP12 (UTC +12:00) Fiji, Gilbert Islands, Kamchatka, New Zealand
+UP1275 (UTC +12:45) Chatham Islands Standard Time
+UP13 (UTC +13:00) Phoenix Islands Time, Tonga
+UP14 (UTC +14:00) Line Islands
=========== ===================================================================== \ No newline at end of file
diff --git a/user_guide_src/source/helpers/directory_helper.rst b/user_guide_src/source/helpers/directory_helper.rst
index 514e80c96..3004316a8 100644
--- a/user_guide_src/source/helpers/directory_helper.rst
+++ b/user_guide_src/source/helpers/directory_helper.rst
@@ -29,11 +29,11 @@ The following functions are available:
.. function:: directory_map($source_dir[, $directory_depth = 0[, $hidden = FALSE]])
- :param string $source_dir: path to the ource directory
- :param integer $directory_depth: depth of directories to traverse (0 =
- fully recursive, 1 = current dir, etc)
- :param boolean $hidden: whether to include hidden directories
- :returns: array
+ :param string $source_dir: Path to the ource directory
+ :param int $directory_depth: Depth of directories to traverse (0 = fully recursive, 1 = current dir, etc)
+ :param bool $hidden: Whether to include hidden directories
+ :returns: An array of files
+ :rtype: array
Examples::
diff --git a/user_guide_src/source/helpers/download_helper.rst b/user_guide_src/source/helpers/download_helper.rst
index 17b68f454..f374d491f 100644
--- a/user_guide_src/source/helpers/download_helper.rst
+++ b/user_guide_src/source/helpers/download_helper.rst
@@ -29,7 +29,7 @@ The following functions are available:
:param string $filename: Filename
:param mixed $data: File contents
:param bool $set_mime: Whether to try to send the actual MIME type
- :returns: void
+ :rtype: void
Generates server headers which force data to be downloaded to your
desktop. Useful with file downloads. The first parameter is the **name
diff --git a/user_guide_src/source/helpers/email_helper.rst b/user_guide_src/source/helpers/email_helper.rst
index fe3ccdda1..b665ce548 100644
--- a/user_guide_src/source/helpers/email_helper.rst
+++ b/user_guide_src/source/helpers/email_helper.rst
@@ -30,8 +30,9 @@ The following functions are available:
.. function:: valid_email($email)
- :param string $email: Email address
- :returns: bool
+ :param string $email: E-mail address
+ :returns: TRUE if a valid email is supplied, FALSE otherwise
+ :rtype: bool
Checks if the input is a correctly formatted e-mail address. Note that is
doesn't actually prove that the address will be able recieve mail, but
@@ -52,13 +53,13 @@ The following functions are available:
(bool) filter_var($email, FILTER_VALIDATE_EMAIL);
-
.. function:: send_email($recipient, $subject, $message)
:param string $recipient: E-mail address
:param string $subject: Mail subject
:param string $message: Message body
- :returns: bool
+ :returns: TRUE if the mail was successfully sent, FALSE in case of an error
+ :rtype: bool
Sends an email using PHP's native `mail() <http://www.php.net/function.mail>`_
function.
@@ -70,4 +71,4 @@ The following functions are available:
mail($recipient, $subject, $message);
For a more robust email solution, see CodeIgniter's :doc:`Email Library
- <../libraries/email>`.
+ <../libraries/email>`. \ No newline at end of file
diff --git a/user_guide_src/source/helpers/file_helper.rst b/user_guide_src/source/helpers/file_helper.rst
index 4d225d278..59cabcce2 100644
--- a/user_guide_src/source/helpers/file_helper.rst
+++ b/user_guide_src/source/helpers/file_helper.rst
@@ -27,7 +27,8 @@ The following functions are available:
.. function:: read_file($file)
:param string $file: File path
- :returns: string or FALSE on failure
+ :returns: File contents or FALSE on failure
+ :rtype: string
Returns the data contained in the file specified in the path.
@@ -48,13 +49,13 @@ The following functions are available:
function might not work if you are trying to access a file above the
calling script.
-
.. function:: write_file($path, $data[, $mode = 'wb'])
:param string $path: File path
:param string $data: Data to write to file
:param string $mode: ``fopen()`` mode
- :returns: bool
+ :returns: TRUE if the write was successful, FALSE in case of an error
+ :rtype: bool
Writes data to the file specified in the path. If the file does not exist then the
function will create it.
@@ -88,13 +89,13 @@ The following functions are available:
.. note:: This function acquires an exclusive lock on the file while writing to it.
-
.. function:: delete_files($path[, $del_dir = FALSE[, $htdocs = FALSE]])
:param string $path: Directory path
:param bool $del_dir: Whether to also delete directories
:param bool $htdocs: Whether to skip deleting .htaccess and index page files
- :returns: bool
+ :returns: TRUE on success, FALSE in case of an error
+ :rtype: bool
Deletes ALL files contained in the supplied path.
@@ -111,12 +112,12 @@ The following functions are available:
.. note:: The files must be writable or owned by the system in order to be deleted.
-
.. function:: get_filenames($source_dir[, $include_path = FALSE])
:param string $source_dir: Directory path
:param bool $include_path: Whether to include the path as part of the filenames
- :returns: array
+ :returns: An array of file names
+ :rtype: array
Takes a server path as input and returns an array containing the names of all files
contained within it. The file path can optionally be added to the file names by setting
@@ -126,13 +127,12 @@ The following functions are available:
$controllers = get_filenames(APPPATH.'controllers/');
-
.. function:: get_dir_file_info($source_dir, $top_level_only)
:param string $source_dir: Directory path
- :param bool $top_level_only: Whether to look only at the specified directory
- (excluding sub-directories)
- :returns: array
+ :param bool $top_level_only: Whether to look only at the specified directory (excluding sub-directories)
+ :returns: An array containing info on the supplied directory's contents
+ :rtype: array
Reads the specified directory and builds an array containing the filenames, filesize,
dates, and permissions. Sub-folders contained within the specified path are only read
@@ -143,12 +143,12 @@ The following functions are available:
$models_info = get_dir_file_info(APPPATH.'models/');
-
.. function:: get_file_info($file[, $returned_values = array('name', 'server_path', 'size', 'date')])
:param string $file: File path
:param array $returned_values: What type of info to return
- :returns: array or FALSE on failure
+ :returns: An array containing info on the specified file or FALSE on failure
+ :rtype: array
Given a file and path, returns (optionally) the *name*, *path*, *size* and *date modified*
information attributes for a file. Second parameter allows you to explicitly declare what
@@ -157,14 +157,11 @@ The following functions are available:
Valid ``$returned_values`` options are: `name`, `size`, `date`, `readable`, `writeable`,
`executable` and `fileperms`.
- .. note:: The *writable* attribute is checked via PHP's ``is_writeable()`` function, which
- known to have issues on the IIS webserver. Consider using *fileperms* instead,
- which returns information from PHP's ``fileperms()`` function.
-
.. function:: get_mime_by_extension($filename)
:param string $filename: File name
- :returns: string or FALSE on failure
+ :returns: MIME type string or FALSE on failure
+ :rtype: string
Translates a filename extension into a MIME type based on *config/mimes.php*.
Returns FALSE if it can't determine the type, or read the MIME config file.
@@ -178,11 +175,11 @@ The following functions are available:
is here strictly for convenience. It should not be used for security
purposes.
-
.. function:: symbolic_permissions($perms)
:param int $perms: Permissions
- :returns: string
+ :returns: Symbolic permissions string
+ :rtype: string
Takes numeric permissions (such as is returned by ``fileperms()``) and returns
standard symbolic notation of file permissions.
@@ -191,11 +188,11 @@ The following functions are available:
echo symbolic_permissions(fileperms('./index.php')); // -rw-r--r--
-
.. function:: octal_permissions($perms)
:param int $perms: Permissions
- :returns: string
+ :returns: Octal permissions string
+ :rtype: string
Takes numeric permissions (such as is returned by ``fileperms()``) and returns
a three character octal notation of file permissions.
diff --git a/user_guide_src/source/helpers/form_helper.rst b/user_guide_src/source/helpers/form_helper.rst
index dcb5bee21..4fa5f246b 100644
--- a/user_guide_src/source/helpers/form_helper.rst
+++ b/user_guide_src/source/helpers/form_helper.rst
@@ -30,7 +30,8 @@ The following functions are available:
:param string $action: Form action/target URI string
:param array $attributes: HTML attributes
:param array $hidden: An array of hidden fields' definitions
- :returns: string
+ :returns: An HTML form opening tag
+ :rtype: string
Creates an opening form tag with a base URL **built from your config preferences**.
It will optionally let you add form attributes and hidden input fields, and
@@ -87,7 +88,8 @@ The following functions are available:
:param string $action: Form action/target URI string
:param array $attributes: HTML attributes
:param array $hidden: An array of hidden fields' definitions
- :returns: string
+ :returns: An HTML multipart form opening tag
+ :rtype: string
This function is absolutely identical to :func:`form_open()` above,
except that it adds a *multipart* attribute, which is necessary if you
@@ -98,7 +100,8 @@ The following functions are available:
:param string $name: Field name
:param string $value: Field value
- :returns: string
+ :returns: An HTML hidden input field tag
+ :rtype: string
Lets you generate hidden input fields. You can either submit a
name/value string to create one field::
@@ -159,13 +162,13 @@ The following functions are available:
<input type="hidden" name="email" value="john@example.com" id="hiddenemail" class="hiddenemail" />
*/
-
.. function:: form_input([$data = ''[, $value = ''[, $extra = '']])
:param array $data: Field attributes data
:param string $value: Field value
:param string $extra: Extra attributes to be added to the tag *as is*
- :returns: string
+ :returns: An HTML text input field tag
+ :rtype: string
Lets you generate a standard text input field. You can minimally pass
the field name and value in the first and second parameter::
@@ -198,13 +201,13 @@ The following functions are available:
$js = 'onClick="some_function()"';
echo form_input('username', 'johndoe', $js);
-
.. function:: form_password([$data = ''[, $value = ''[, $extra = '']]])
:param array $data: Field attributes data
:param string $value: Field value
:param string $extra: Extra attributes to be added to the tag *as is*
- :returns: string
+ :returns: An HTML password input field tag
+ :rtype: string
This function is identical in all respects to the :func:`form_input()`
function above except that it uses the "password" input type.
@@ -215,7 +218,8 @@ The following functions are available:
:param array $data: Field attributes data
:param string $value: Field value
:param string $extra: Extra attributes to be added to the tag *as is*
- :returns: string
+ :returns: An HTML file upload input field tag
+ :rtype: string
This function is identical in all respects to the :func:`form_input()`
function above except that it uses the "file" input type, allowing it to
@@ -227,7 +231,8 @@ The following functions are available:
:param array $data: Field attributes data
:param string $value: Field value
:param string $extra: Extra attributes to be added to the tag *as is*
- :returns: string
+ :returns: An HTML textarea tag
+ :rtype: string
This function is identical in all respects to the :func:`form_input()`
function above except that it generates a "textarea" type.
@@ -235,14 +240,14 @@ The following functions are available:
.. note:: Instead of the *maxlength* and *size* attributes in the above example,
you will instead specify *rows* and *cols*.
-
.. function:: form_dropdown([$name = ''[, $options = array()[, $selected = array()[, $extra = '']]]])
:param string $name: Field name
:param array $options: An associative array of options to be listed
:param array $selected: List of fields to mark with the *selected* attribute
:param string $extra: Extra attributes to be added to the tag *as is*
- :returns: string
+ :returns: An HTML dropdown select field tag
+ :rtype: string
Lets you create a standard drop-down field. The first parameter will
contain the name of the field, the second parameter will contain an
@@ -305,7 +310,8 @@ The following functions are available:
:param array $options: An associative array of options to be listed
:param array $selected: List of fields to mark with the *selected* attribute
:param string $extra: Extra attributes to be added to the tag *as is*
- :returns: string
+ :returns: An HTML dropdown multiselect field tag
+ :rtype: string
Lets you create a standard multiselect field. The first parameter will
contain the name of the field, the second parameter will contain an
@@ -321,7 +327,8 @@ The following functions are available:
:param string $legend_text: Text to put in the <legend> tag
:param array $attributes: Attributes to be set on the <fieldset> tag
- :returns: string
+ :returns: An HTML fieldset opening tag
+ :rtype: string
Lets you generate fieldset/legend fields.
@@ -365,7 +372,9 @@ The following functions are available:
.. function:: form_fieldset_close([$extra = ''])
:param string $extra: Anything to append after the closing tag, *as is*
- :returns: string
+ :returns: An HTML fieldset closing tag
+ :rtype: string
+
Produces a closing </fieldset> tag. The only advantage to using this
function is it permits you to pass data to it which will be added below
@@ -384,7 +393,8 @@ The following functions are available:
:param string $value: Field value
:param bool $checked: Whether to mark the checkbox as being *checked*
:param string $extra: Extra attributes to be added to the tag *as is*
- :returns: string
+ :returns: An HTML checkbox input tag
+ :rtype: string
Lets you generate a checkbox field. Simple example::
@@ -422,7 +432,8 @@ The following functions are available:
:param string $value: Field value
:param bool $checked: Whether to mark the radio button as being *checked*
:param string $extra: Extra attributes to be added to the tag *as is*
- :returns: string
+ :returns: An HTML radio input tag
+ :rtype: string
This function is identical in all respects to the :func:`form_checkbox()`
function above except that it uses the "radio" input type.
@@ -433,7 +444,8 @@ The following functions are available:
:param string $label_text: Text to put in the <label> tag
:param string $id: ID of the form element that we're making a label for
:param string $attributes: HTML attributes
- :returns: string
+ :returns: An HTML field label tag
+ :rtype: string
Lets you generate a <label>. Simple example::
@@ -459,7 +471,8 @@ The following functions are available:
:param string $data: Button name
:param string $value: Button value
:param string $extra: Extra attributes to be added to the tag *as is*
- :returns: string
+ :returns: An HTML input submit tag
+ :rtype: string
Lets you generate a standard submit button. Simple example::
@@ -476,7 +489,8 @@ The following functions are available:
:param string $data: Button name
:param string $value: Button value
:param string $extra: Extra attributes to be added to the tag *as is*
- :returns: string
+ :returns: An HTML input reset button tag
+ :rtype: string
Lets you generate a standard reset button. Use is identical to
:func:`form_submit()`.
@@ -487,7 +501,8 @@ The following functions are available:
:param string $data: Button name
:param string $content: Button label
:param string $extra: Extra attributes to be added to the tag *as is*
- :returns: string
+ :returns: An HTML button tag
+ :rtype: string
Lets you generate a standard button element. You can minimally pass the
button name and content in the first and second parameter::
@@ -519,7 +534,8 @@ The following functions are available:
.. function:: form_close([$extra = ''])
:param string $extra: Anything to append after the closing tag, *as is*
- :returns: string
+ :returns: An HTML form closing tag
+ :rtype: string
Produces a closing </form> tag. The only advantage to using this
function is it permits you to pass data to it which will be added below
@@ -534,7 +550,8 @@ The following functions are available:
:param string $str: Value to escape
:param bool $is_textarea: Whether we're preparing for <textarea> or a regular input tag
- :returns: string
+ :returns: Escaped value
+ :rtype: string
Allows you to safely use HTML and characters such as quotes within form
elements without breaking out of the form.
@@ -560,7 +577,8 @@ The following functions are available:
:param string $field: Field name
:param string $default: Default value
:param bool $is_textarea: Whether we're setting <textarea> content
- :returns: string
+ :returns: Field value
+ :rtype: string
Permits you to set the value of an input form or textarea. You must
supply the field name via the first parameter of the function. The
@@ -579,7 +597,8 @@ The following functions are available:
:param string $field: Field name
:param string $value: Value to check for
:param string $default: Whether the value is also a default one
- :returns: string
+ :returns: 'selected' attribute or an empty string
+ :rtype: string
If you use a <select> menu, this function permits you to display the
menu item that was selected.
@@ -596,13 +615,13 @@ The following functions are available:
<option value="three" <?php echo set_select('myselect', 'three'); ?> >Three</option>
</select>
-
.. function:: set_checkbox([$field = ''[, $value = ''[, $default = FALSE]]])
:param string $field: Field name
:param string $value: Value to check for
:param string $default: Whether the value is also a default one
- :returns: string
+ :returns: 'checked' attribute or an empty string
+ :rtype: string
Permits you to display a checkbox in the state it was submitted.
@@ -615,13 +634,13 @@ The following functions are available:
<input type="checkbox" name="mycheck" value="1" <?php echo set_checkbox('mycheck', '1'); ?> />
<input type="checkbox" name="mycheck" value="2" <?php echo set_checkbox('mycheck', '2'); ?> />
-
.. function:: set_radio([$field = ''[, $value = ''[, $default = FALSE]]])
:param string $field: Field name
:param string $value: Value to check for
:param string $default: Whether the value is also a default one
- :returns: string
+ :returns: 'checked' attribute or an empty string
+ :rtype: string
Permits you to display radio buttons in the state they were submitted.
This function is identical to the :func:`set_checkbox()` function above.
@@ -637,13 +656,13 @@ The following functions are available:
defined, the control for ``set_*()`` is handed over to a method of the
class instead of the generic helper function.
-
.. function:: form_error([$field = ''[, $prefix = ''[, $suffix = '']]])
:param string $field: Field name
:param string $prefix: Error opening tag
:param string $suffix: Error closing tag
- :returns: string
+ :returns: HTML-formatted form validation error message(s)
+ :rtype: string
Returns a validation error message from the :doc:`Form Validation Library
<../libraries/form_validation>`, associated with the specified field name.
@@ -662,7 +681,8 @@ The following functions are available:
:param string $prefix: Error opening tag
:param string $suffix: Error closing tag
- :returns: string
+ :returns: HTML-formatted form validation error message(s)
+ :rtype: string
Similarly to the :func:`form_error()` function, returns all validation
error messages produced by the :doc:`Form Validation Library
diff --git a/user_guide_src/source/helpers/html_helper.rst b/user_guide_src/source/helpers/html_helper.rst
index 9e9d7ca62..3324da8c0 100644
--- a/user_guide_src/source/helpers/html_helper.rst
+++ b/user_guide_src/source/helpers/html_helper.rst
@@ -28,7 +28,8 @@ The following functions are available:
.. function:: br([$count = 1])
:param int $count: Number of times to repeat the tag
- :returns: string
+ :returns: HTML line break tag
+ :rtype: string
Generates line break tags (<br />) based on the number you submit.
Example::
@@ -41,13 +42,13 @@ The following functions are available:
<br /><br /><br />
-
.. function:: heading([$data = ''[, $h = '1'[, $attributes = '']]])
:param string $data: Content
:param string $h: Heading level
:param array $attributes: HTML attributes
- :returns: string
+ :returns: HTML heading tag
+ :rtype: string
Lets you create HTML heading tags. The first parameter will contain the
data, the second the size of the heading. Example::
@@ -67,13 +68,13 @@ The following functions are available:
<h3 class="pink">Welcome!<h3>
-
.. function:: img([$src = ''[, $index_page = FALSE[, $attributes = '']]])
:param string $src: Image source data
:param bool $index_page: Whether to treat $src as a routed URI string
:param array $attributes: HTML attributes
- :returns: string
+ :returns: HTML image tag
+ :rtype: string
Lets you create HTML <img /> tags. The first parameter contains the
image source. Example::
@@ -106,8 +107,7 @@ The following functions are available:
img($image_properties);
// <img src="http://site.com/index.php/images/picture.jpg" alt="Me, demonstrating how to eat 4 slices of pizza at one time" class="post_images" width="200" height="200" title="That was quite a night" rel="lightbox" />
-
-.. function:: ling_tag([$href = ''[, $rel = 'stylesheet'[, $type = 'text/css'[, $title = ''[, $media = ''[, $index_page = FALSE]]]]]])
+.. function:: link_tag([$href = ''[, $rel = 'stylesheet'[, $type = 'text/css'[, $title = ''[, $media = ''[, $index_page = FALSE]]]]]])
:param string $href: What are we linking to
:param string $rel: Relation type
@@ -115,7 +115,8 @@ The following functions are available:
:param string $title: Link title
:param string $media: Media type
:param bool $index_page: Whether to treat $src as a routed URI string
- :returns: string
+ :returns: HTML link tag
+ :rtype: string
Lets you create HTML <link /> tags. This is useful for stylesheet links,
as well as other links. The parameters are *href*, with optional *rel*,
@@ -150,11 +151,11 @@ The following functions are available:
echo link_tag($link);
// <link href="http://site.com/css/printer.css" rel="stylesheet" type="text/css" media="print" />
-
.. function:: nbs([$num = 1])
:param int $num: Number of space entities to produce
- :returns: string
+ :returns: A sequence of non-breaking space HTML entities
+ :rtype: string
Generates non-breaking spaces (&nbsp;) based on the number you submit.
Example::
@@ -172,7 +173,8 @@ The following functions are available:
:param array $list: List entries
:param array $attributes: HTML attributes
- :returns: string
+ :returns: HTML-formatted unordered list
+ :rtype: string
Permits you to generate ordered or unordered HTML lists from simple or
multi-dimensional arrays. Example::
@@ -291,19 +293,20 @@ The following functions are available:
:param array $list: List entries
:param array $attributes: HTML attributes
- :returns: string
+ :returns: HTML-formatted ordered list
+ :rtype: string
Identical to :func:`ul()`, only it produces the <ol> tag for
ordered lists instead of <ul>.
-
.. function:: meta([$name = ''[, $content = ''[, $type = 'name'[, $newline = "\n"]]]])
:param string $name: Meta name
:param string $content: Meta content
:param string $type: Meta type
:param string $newline: Newline character
- :returns: string
+ :returns: HTML meta tag
+ :rtype: string
Helps you generate meta tags. You can pass strings to the function, or
simple arrays, or multidimensional ones.
@@ -355,6 +358,8 @@ The following functions are available:
.. function:: doctype([$type = 'xhtml1-strict'])
:param string $type: Doctype name
+ :returns: HTML DocType tag
+ :rtype: string
Helps you generate document type declarations, or DTD's. XHTML 1.0
Strict is used by default, but many doctypes are available.
@@ -368,44 +373,26 @@ The following functions are available:
The following is a list of doctype choices. These are configurable, and
pulled from application/config/doctypes.php
- +-------------------------------+------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
- | Doctype | Option | Result |
- +===============================+==============================+==================================================================================================================================================+
- | XHTML 1.1 | doctype('xhtml11') | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
- +-------------------------------+------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
- | XHTML 1.0 Strict | doctype('xhtml1-strict') | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
- +-------------------------------+------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
- | XHTML 1.0 Transitional | doctype('xhtml1-trans') | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
- +-------------------------------+------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
- | XHTML 1.0 Frameset | doctype('xhtml1-frame') | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"> |
- +-------------------------------+------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
- | XHTML Basic 1.1 | doctype('xhtml-basic11') | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd"> |
- +-------------------------------+------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
- | HTML 5 | doctype('html5') | <!DOCTYPE html> |
- +-------------------------------+------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
- | HTML 4 Strict | doctype('html4-strict') | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> |
- +-------------------------------+------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
- | HTML 4 Transitional | doctype('html4-trans') | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
- +-------------------------------+------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
- | HTML 4 Frameset | doctype('html4-frame') | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd"> |
- +-------------------------------+------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
- | MathML 1.01 | doctype('mathml1') | <!DOCTYPE math SYSTEM "http://www.w3.org/Math/DTD/mathml1/mathml.dtd"> |
- +-------------------------------+------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
- | MathML 2.0 | doctype('mathml2') | <!DOCTYPE math PUBLIC "-//W3C//DTD MathML 2.0//EN" "http://www.w3.org/Math/DTD/mathml2/mathml2.dtd"> |
- +-------------------------------+------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
- | SVG 1.0 | doctype('svg10') | <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"> |
- +-------------------------------+------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
- | SVG 1.1 Full | doctype('svg11') | <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> |
- +-------------------------------+------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
- | SVG 1.1 Basic | doctype('svg11-basic') | <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Basic//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd"> |
- +-------------------------------+------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
- | SVG 1.1 Tiny | doctype('svg11-tiny') | <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd"> |
- +-------------------------------+------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
- | XHTML+MathML+SVG (XHTML host) | doctype('xhtml-math-svg-xh') | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd"> |
- +-------------------------------+------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
- | XHTML+MathML+SVG (SVG host) | doctype('xhtml-math-svg-sh') | <!DOCTYPE svg:svg PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd"> |
- +-------------------------------+------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
- | XHTML+RDFa 1.0 | doctype('xhtml-rdfa-1') | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd"> |
- +-------------------------------+------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
- | XHTML+RDFa 1.1 | doctype('xhtml-rdfa-2') | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.1//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-2.dtd"> |
- +-------------------------------+------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ \ No newline at end of file
+ =============================== =================== ==================================================================================================================================================
+ Document type Option Result
+ =============================== =================== ==================================================================================================================================================
+ XHTML 1.1 xhtml11 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+ XHTML 1.0 Strict xhtml1-strict <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+ XHTML 1.0 Transitional xhtml1-trans <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+ XHTML 1.0 Frameset xhtml1-frame <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
+ XHTML Basic 1.1 xhtml-basic11 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd">
+ HTML 5 html5 <!DOCTYPE html>
+ HTML 4 Strict html4-strict <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+ HTML 4 Transitional html4-trans <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+ HTML 4 Frameset html4-frame <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
+ MathML 1.01 mathml1 <!DOCTYPE math SYSTEM "http://www.w3.org/Math/DTD/mathml1/mathml.dtd">
+ MathML 2.0 mathml2 <!DOCTYPE math PUBLIC "-//W3C//DTD MathML 2.0//EN" "http://www.w3.org/Math/DTD/mathml2/mathml2.dtd">
+ SVG 1.0 svg10 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+ SVG 1.1 Full svg11 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+ SVG 1.1 Basic svg11-basic <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Basic//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd">
+ SVG 1.1 Tiny svg11-tiny <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+ XHTML+MathML+SVG (XHTML host) xhtml-math-svg-xh <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">
+ XHTML+MathML+SVG (SVG host) xhtml-math-svg-sh <!DOCTYPE svg:svg PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">
+ XHTML+RDFa 1.0 xhtml-rdfa-1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
+ XHTML+RDFa 1.1 xhtml-rdfa-2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.1//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-2.dtd">
+ =============================== =================== ================================================================================================================================================== \ No newline at end of file
diff --git a/user_guide_src/source/helpers/inflector_helper.rst b/user_guide_src/source/helpers/inflector_helper.rst
index 717ecc678..d0cb17c18 100644
--- a/user_guide_src/source/helpers/inflector_helper.rst
+++ b/user_guide_src/source/helpers/inflector_helper.rst
@@ -28,50 +28,51 @@ The following functions are available:
.. function:: singular($str)
:param string $str: Input string
- :returns: string
+ :returns: A singular word
+ :rtype: string
Changes a plural word to singular. Example::
echo singular('dogs'); // Prints 'dog'
-
.. function:: plural($str)
:param string $str: Input string
- :returns: string
+ :returns: A plular word
+ :rtype: string
Changes a singular word to plural. Example::
echo plural('dog'); // Prints 'dogs'
-
.. function:: camelize($str)
:param string $str: Input string
- :returns: string
+ :returns: Camelized string
+ :rtype: string
Changes a string of words separated by spaces or underscores to camel
case. Example::
echo camelize('my_dog_spot'); // Prints 'myDogSpot'
-
.. function:: underscore($str)
:param string $str: Input string
- :returns: string
+ :returns: String containing underscores instead of spaces
+ :rtype: string
Takes multiple words separated by spaces and underscores them.
Example::
echo underscore('my dog spot'); // Prints 'my_dog_spot'
-
.. function:: humanize($str[, $separator = '_'])
:param string $str: Input string
:param string $separator: Input separator
- :returns: string
+ :returns: Humanized string
+ :rtype: string
Takes multiple words separated by underscores and adds spaces between
them. Each word is capitalized.
@@ -84,11 +85,11 @@ The following functions are available:
echo humanize('my-dog-spot', '-'); // Prints 'My Dog Spot'
-
.. function:: is_countable($word)
:param string $word: Input string
- :returns: bool
+ :returns: TRUE if the word is countable or FALSE if not
+ :rtype: bool
Checks if the given word has a plural version. Example::
diff --git a/user_guide_src/source/helpers/language_helper.rst b/user_guide_src/source/helpers/language_helper.rst
index 9e5d9bdc9..e4d093725 100644
--- a/user_guide_src/source/helpers/language_helper.rst
+++ b/user_guide_src/source/helpers/language_helper.rst
@@ -27,16 +27,17 @@ The following functions are available:
.. function:: lang($line[, $for = ''[, $attributes = array()]])
- :param string $line: Language line key
- :param string $for: HTML "for" attribute (ID of the element we're creating a label for)
- :param array $attributes: Any additional HTML attributes
- :returns: string
+ :param string $line: Language line key
+ :param string $for: HTML "for" attribute (ID of the element we're creating a label for)
+ :param array $attributes: Any additional HTML attributes
+ :returns: HTML-formatted language line label
+ :rtype: string
- This function returns a line of text from a loaded language file with
- simplified syntax that may be more desirable for view files than
- ``CI_Lang::line()``.
+ This function returns a line of text from a loaded language file with
+ simplified syntax that may be more desirable for view files than
+ ``CI_Lang::line()``.
- Example::
+ Example::
- echo lang('language_key', 'form_item_id', array('class' => 'myClass');
- // Outputs: <label for="form_item_id" class="myClass">Language line</label> \ No newline at end of file
+ echo lang('language_key', 'form_item_id', array('class' => 'myClass'));
+ // Outputs: <label for="form_item_id" class="myClass">Language line</label> \ No newline at end of file
diff --git a/user_guide_src/source/helpers/number_helper.rst b/user_guide_src/source/helpers/number_helper.rst
index 5a3d72b00..2de4457d9 100644
--- a/user_guide_src/source/helpers/number_helper.rst
+++ b/user_guide_src/source/helpers/number_helper.rst
@@ -29,7 +29,8 @@ The following functions are available:
:param mixed $num: Number of bytes
:param int $precision: Floating point precision
- :returns: string
+ :returns: Formatted data size string
+ :rtype: string
Formats numbers as bytes, based on size, and adds the appropriate
suffix. Examples::
@@ -48,4 +49,4 @@ The following functions are available:
echo byte_format(45678, 2); // Returns 44.61 KB
.. note:: The text generated by this function is found in the following
- language file: `language/<your_lang>/number_lang.php` \ No newline at end of file
+ language file: *language/<your_lang>/number_lang.php* \ No newline at end of file
diff --git a/user_guide_src/source/helpers/path_helper.rst b/user_guide_src/source/helpers/path_helper.rst
index 61877d75b..705ca23b9 100644
--- a/user_guide_src/source/helpers/path_helper.rst
+++ b/user_guide_src/source/helpers/path_helper.rst
@@ -29,7 +29,8 @@ The following functions are available:
:param string $path: Path
:param bool $check_existance: Whether to check if the path actually exists
- :returns: string
+ :returns: An absolute path
+ :rtype: string
This function will return a server path without symbolic links or
relative directory structures. An optional second argument will
diff --git a/user_guide_src/source/helpers/security_helper.rst b/user_guide_src/source/helpers/security_helper.rst
index 7df85d017..2e26890b0 100644
--- a/user_guide_src/source/helpers/security_helper.rst
+++ b/user_guide_src/source/helpers/security_helper.rst
@@ -28,18 +28,19 @@ The following functions are available:
:param string $str: Input data
:param bool $is_image: Whether we're dealing with an image
- :returns: string
+ :returns: XSS-clean string
+ :rtype: string
Provides Cross Site Script Hack filtering.
This function is an alias for ``CI_Input::xss_clean()``. For more info,
please see the :doc:`Input Library <../libraries/input>` documentation.
-
.. function:: sanitize_filename($filename)
:param string $filename: Filename
- :returns: string
+ :returns: Sanitized file name
+ :rtype: string
Provides protection against directory traversal.
@@ -52,7 +53,8 @@ The following functions are available:
:param string $str: Input
:param string $type: Algorithm
- :returns: string
+ :returns: Hex-formatted hash
+ :rtype: string
Permits you to create one way hashes suitable for encrypting
passwords. Will use SHA1 by default.
@@ -73,8 +75,9 @@ The following functions are available:
.. function:: strip_image_tags($str)
- :param string $str: Input
- :returns: string
+ :param string $str: Input string
+ :returns: The input string with no image tags
+ :rtype: string
This is a security function that will strip image tags from a string.
It leaves the image URL as plain text.
@@ -90,8 +93,9 @@ The following functions are available:
.. function:: encode_php_tags($str)
- :param string $str: Input
- :returns: string
+ :param string $str: Input string
+ :returns: Safely formatted string
+ :rtype: string
This is a security function that converts PHP tags to entities.
diff --git a/user_guide_src/source/helpers/smiley_helper.rst b/user_guide_src/source/helpers/smiley_helper.rst
index 077c56a17..b98084089 100644
--- a/user_guide_src/source/helpers/smiley_helper.rst
+++ b/user_guide_src/source/helpers/smiley_helper.rst
@@ -116,7 +116,8 @@ Available Functions
:param string $image_url: URL path to the smileys directory
:param string $alias: Field alias
- :returns: array
+ :returns: An array of ready to use smileys
+ :rtype: array
Returns an array containing your smiley images wrapped in a clickable
link. You must supply the URL to your smiley folder and a field id or
@@ -124,14 +125,15 @@ Available Functions
Example::
- $image_array = get_smiley_links("http://example.com/images/smileys/", "comment");
-
+ $image_array = get_clickable_smileys('http://example.com/images/smileys/', 'comment');
.. function:: smiley_js([$alias = ''[, $field_id = ''[, $inline = TRUE]]])
:param string $alias: Field alias
:param string $field_id: Field ID
:param bool $inline: Whether we're inserting an inline smiley
+ :returns: Smiley-enabling JavaScript code
+ :rtype: string
Generates the JavaScript that allows the images to be clicked and
inserted into a form field. If you supplied an alias instead of an id
@@ -143,13 +145,13 @@ Available Functions
<?php echo smiley_js(); ?>
-
.. function:: parse_smileys([$str = ''[, $image_url = ''[, $smileys = NULL]]])
:param string $str: Text containing smiley codes
:param string $image_url: URL path to the smileys directory
:param array $smileys: An array of smileys
- :returns: string
+ :returns: Parsed smileys
+ :rtype: string
Takes a string of text as input and replaces any contained plain text
smileys into the image equivalent. The first parameter must contain your
diff --git a/user_guide_src/source/helpers/string_helper.rst b/user_guide_src/source/helpers/string_helper.rst
index 1ca654ea6..922bc6b8d 100644
--- a/user_guide_src/source/helpers/string_helper.rst
+++ b/user_guide_src/source/helpers/string_helper.rst
@@ -29,7 +29,8 @@ The following functions are available:
:param string $type: Randomization type
:param int $len: Output string length
- :returns: string
+ :returns: A random string
+ :rtype: string
Generates a random string based on the type and length you specify.
Useful for creating passwords or generating random hashes.
@@ -52,13 +53,13 @@ The following functions are available:
.. note:: Usage of the *unique* and *encrypt* types is DEPRECATED. They
are just aliases for *md5* and *sha1* respectively.
-
.. function:: increment_string($str[, $separator = '_'[, $first = 1]])
:param string $str: Input string
:param string $separator: Separator to append a duplicate number with
:param int $first: Starting number
- :returns: string
+ :returns: An incremented string
+ :rtype: string
Increments a string by appending a number to it or increasing the
number. Useful for creating "copies" or a file or duplicating database
@@ -74,7 +75,8 @@ The following functions are available:
.. function:: alternator($args)
:param mixed $args: A variable number of arguments
- :returns: mixed
+ :returns: Alternated string(s)
+ :rtype: mixed
Allows two or more items to be alternated between, when cycling through
a loop. Example::
@@ -97,12 +99,12 @@ The following functions are available:
.. note:: To use multiple separate calls to this function simply call the
function with no arguments to re-initialize.
-
.. function:: repeater($data[, $num = 1])
:param string $data: Input
:param int $num: Number of times to repeat
- :returns: string
+ :returns: Repeated string
+ :rtype: string
Generates repeating copies of the data you submit. Example::
@@ -118,7 +120,8 @@ The following functions are available:
.. function:: reduce_double_slashes($str)
:param string $str: Input string
- :returns: string
+ :returns: A string with normalized slashes
+ :rtype: string
Converts double slashes in a string to a single slash, except those
found in URL protocol prefixes (e.g. http://).
@@ -131,10 +134,11 @@ The following functions are available:
.. function:: strip_slashes($data)
- :param array $data: Input
- :returns: array
+ :param mixed $data: Input string or an array of strings
+ :returns: String(s) with stripped slashes
+ :rtype: mixed
-Removes any slashes from an array of strings.
+ Removes any slashes from an array of strings.
Example::
@@ -156,11 +160,11 @@ Removes any slashes from an array of strings.
and handle string inputs. This however makes it just an
alias for ``stripslashes()``.
-
.. function:: trim_slashes($str)
:param string $str: Input string
- :returns: string
+ :returns: Slash-trimmed string
+ :rtype: string
Removes any leading/trailing slashes from a string. Example::
@@ -171,13 +175,13 @@ Removes any slashes from an array of strings.
|
| trim($str, '/');
-
.. function:: reduce_multiples($str[, $character = ''[, $trim = FALSE]])
:param string $str: Text to search in
:param string $character: Character to reduce
:param bool $trim: Whether to also trim the specified character
- :returns: string
+ :returns: Reduced string
+ :rtype: string
Reduces multiple instances of a particular character occuring directly
after each other. Example::
@@ -191,11 +195,11 @@ Removes any slashes from an array of strings.
$string = ",Fred, Bill,, Joe, Jimmy,";
$string = reduce_multiples($string, ", ", TRUE); //results in "Fred, Bill, Joe, Jimmy"
-
.. function:: quotes_to_entities($str)
:param string $str: Input string
- :returns: string
+ :returns: String with quotes converted to HTML entities
+ :rtype: string
Converts single and double quotes in a string to the corresponding HTML
entities. Example::
@@ -207,7 +211,8 @@ Removes any slashes from an array of strings.
.. function:: strip_quotes($str)
:param string $str: Input string
- :returns: string
+ :returns: String with quotes stripped
+ :rtype: string
Removes single and double quotes from a string. Example::
diff --git a/user_guide_src/source/helpers/text_helper.rst b/user_guide_src/source/helpers/text_helper.rst
index 788fe8b0c..88a6d0658 100644
--- a/user_guide_src/source/helpers/text_helper.rst
+++ b/user_guide_src/source/helpers/text_helper.rst
@@ -29,7 +29,8 @@ The following functions are available:
:param string $str: Input string
:param int $limit: Limit
:param string $end_char: End character (usually an ellipsis)
- :returns: string
+ :returns: Word-limited string
+ :rtype: string
Truncates a string to the number of *words* specified. Example::
@@ -46,7 +47,8 @@ The following functions are available:
:param string $str: Input string
:param int $n: Number of characters
:param string $end_char: End character (usually an ellipsis)
- :returns: string
+ :returns: Character-limited string
+ :rtype: string
Truncates a string to the number of *characters* specified. It
maintains the integrity of words so the character count may be slightly
@@ -64,11 +66,11 @@ The following functions are available:
.. note:: If you need to truncate to an exact number of characters please
see the :func:`ellipsize()` function below.
-
.. function:: ascii_to_entities($str)
:param string $str: Input string
- :returns: string
+ :returns: A string with ASCII values converted to entities
+ :rtype: string
Converts ASCII values to character entities, including high ASCII and MS
Word characters that can cause problems when used in a web page, so that
@@ -82,21 +84,21 @@ The following functions are available:
$string = ascii_to_entities($string);
-
.. function::entities_to_ascii($str[, $all = TRUE])
:param string $str: Input string
:param bool $all: Whether to convert unsafe entities as well
- :returns: string
+ :returns: A string with HTML entities converted to ASCII characters
+ :rtype: string
This function does the opposite of :func:`ascii_to_entities()`.
It turns character entities back into ASCII.
-
.. function:: convert_accented_characters($str)
:param string $str: Input string
- :returns: string
+ :returns: A string with accented characters converted
+ :rtype: string
Transliterates high ASCII characters to low ASCII equivalents. Useful
when non-English characters need to be used where only standard ASCII
@@ -110,13 +112,13 @@ The following functions are available:
`application/config/foreign_chars.php` to define the to and
from array for transliteration.
-
.. function:: word_censor($str, $censored[, $replacement = ''])
:param string $str: Input string
:param array $censored: List of bad words to censor
:param string $replacement: What to replace bad words with
- :returns: string
+ :returns: Censored string
+ :rtype: string
Enables you to censor words within a text string. The first parameter
will contain the original string. The second will contain an array of
@@ -129,11 +131,11 @@ The following functions are available:
$disallowed = array('darn', 'shucks', 'golly', 'phooey');
$string = word_censor($string, $disallowed, 'Beep!');
-
.. function:: highlight_code($str)
:param string $str: Input string
- :returns: string
+ :returns: String with code highlighted via HTML
+ :rtype: string
Colorizes a string of code (PHP, HTML, etc.). Example::
@@ -149,7 +151,8 @@ The following functions are available:
:param string $phrase: Phrase to highlight
:param string $tag_open: Opening tag used for the highlight
:param string $tag_close: Closing tag for the highlight
- :returns: string
+ :returns: String with a phrase highlighted via HTML
+ :rtype: string
Will highlight a phrase within a text string. The first parameter will
contain the original string, the second will contain the phrase you wish
@@ -175,12 +178,12 @@ The following functions are available:
color: #000;
};
-
.. function:: word_wrap($str[, $charlim = 76])
:param string $str: Input string
:param int $charlim: Character limit
- :returns: string
+ :returns: Word-wrapped string
+ :rtype: string
Wraps text at the specified *character* count while maintaining
complete words.
@@ -192,15 +195,14 @@ The following functions are available:
// Would produce: Here is a simple string of text that will help us demonstrate this function
-
.. function:: ellipsize($str, $max_length[, $position = 1[, $ellipsis = '&hellip;']])
:param string $str: Input string
:param int $max_length: String length limit
- :param mixed $position: Position to split at
- (int or float)
+ :param mixed $position: Position to split at (int or float)
:param string $ellipsis: What to use as the ellipsis character
- :returns: string
+ :returns: Ellipsized string
+ :rtype: string
This function will strip tags from a string, split it at a defined
maximum length, and insert an ellipsis.
diff --git a/user_guide_src/source/helpers/typography_helper.rst b/user_guide_src/source/helpers/typography_helper.rst
index d32befac1..deb3d164e 100644
--- a/user_guide_src/source/helpers/typography_helper.rst
+++ b/user_guide_src/source/helpers/typography_helper.rst
@@ -29,7 +29,8 @@ The following functions are available:
:param string $str: Input string
:param bool $reduce_linebreaks: Whether to reduce multiple instances of double newlines to two
- :returns: string
+ :returns: HTML-formatted typography-safe string
+ :rtype: string
Formats text so that it is semantically and typographically correct
HTML.
@@ -51,7 +52,8 @@ The following functions are available:
.. function:: nl2br_except_pre($str)
:param string $str: Input string
- :returns: string
+ :returns: String with HTML-formatted line breaks
+ :rtype: string
Converts newlines to <br /> tags unless they appear within <pre> tags.
This function is identical to the native PHP ``nl2br()`` function,
@@ -61,12 +63,12 @@ The following functions are available:
$string = nl2br_except_pre($string);
-
.. function:: entity_decode($str, $charset = NULL)
:param string $str: Input string
:param string $charset: Character set
- :returns: string
+ :returns: String with decoded HTML entities
+ :rtype: string
This function is an alias for ``CI_Security::entity_decode()``.
Fore more info, please see the :doc:`Security Library
diff --git a/user_guide_src/source/helpers/url_helper.rst b/user_guide_src/source/helpers/url_helper.rst
index 24c7e259f..3bdcb8e17 100644
--- a/user_guide_src/source/helpers/url_helper.rst
+++ b/user_guide_src/source/helpers/url_helper.rst
@@ -27,7 +27,8 @@ Available Functions
:param string $uri: URI string
:param string $protocol: Protocol, e.g. 'http' or 'https'
- :returns: string
+ :returns: Site URL
+ :rtype: string
Returns your site URL, as specified in your config file. The index.php
file (or whatever you have set as your site **index_page** in your config
@@ -54,13 +55,12 @@ Available Functions
This function is an alias for ``CI_Config::site_url()``. For more info,
please see the :doc:`Config Library <../libraries/config>` documentation.
-
-
.. function:: base_url($uri = '', $protocol = NULL)
:param string $uri: URI string
:param string $protocol: Protocol, e.g. 'http' or 'https'
- :returns: string
+ :returns: Base URL
+ :rtype: string
Returns your site base URL, as specified in your config file. Example::
@@ -88,10 +88,10 @@ Available Functions
This function is an alias for ``CI_Config::base_url()``. For more info,
please see the :doc:`Config Library <../libraries/config>` documentation.
-
.. function:: current_url()
- :returns: string
+ :returns: The current URL
+ :rtype: string
Returns the full URL (including segments) of the page being currently
viewed.
@@ -103,7 +103,8 @@ Available Functions
.. function:: uri_string()
- :returns: string
+ :returns: An URI string
+ :rtype: string
Returns the URI segments of any page that contains this function.
For example, if your URL was this::
@@ -120,20 +121,21 @@ Available Functions
.. function:: index_page()
- :returns: string
+ :returns: 'index_page' value
+ :rtype: mixed
Returns your site **index_page**, as specified in your config file.
Example::
echo index_page();
-
.. function:: anchor($uri = '', $title = '', $attributes = '')
:param string $uri: URI string
:param string $title: Anchor title
:param mixed $attributes: HTML attributes
- :returns: string
+ :returns: HTML hyperlink (anchor tag)
+ :rtype: string
Creates a standard HTML anchor link based on your local site URL.
@@ -170,7 +172,8 @@ Available Functions
:param string $uri: URI string
:param string $title: Anchor title
:param mixed $attributes: HTML attributes
- :returns: string
+ :returns: Pop-up hyperlink
+ :rtype: string
Nearly identical to the :func:`anchor()` function except that it
opens the URL in a new window. You can specify JavaScript window
@@ -213,7 +216,8 @@ Available Functions
:param string $email: E-mail address
:param string $title: Anchor title
:param mixed $attributes: HTML attributes
- :returns: string
+ :returns: A "mail to" hyperlink
+ :rtype: string
Creates a standard HTML e-mail link. Usage example::
@@ -225,25 +229,25 @@ Available Functions
$attributes = array('title' => 'Mail me');
echo mailto('me@my-site.com', 'Contact Me', $attributes);
-
.. function:: safe_mailto($email, $title = '', $attributes = '')
:param string $email: E-mail address
:param string $title: Anchor title
:param mixed $attributes: HTML attributes
- :returns: string
+ :returns: A spam-safe "mail to" hyperlink
+ :rtype: string
Identical to the :func:`mailto()` function except it writes an obfuscated
version of the *mailto* tag using ordinal numbers written with JavaScript to
help prevent the e-mail address from being harvested by spam bots.
-
.. function:: auto_link($str, $type = 'both', $popup = FALSE)
:param string $str: Input string
:param string $type: Link type ('email', 'url' or 'both')
:param bool $popup: Whether to create popup links
- :returns: string
+ :returns: Linkified string
+ :rtype: string
Automatically turns URLs and e-mail addresses contained in a string into
links. Example::
@@ -274,7 +278,8 @@ Available Functions
:param string $str: Input string
:param string $separator: Word separator
:param string $lowercase: Whether to transform the output string to lower-case
- :returns: string
+ :returns: URL-formatted string
+ :rtype: string
Takes a string as input and creates a human-friendly URL string. This is
useful if, for example, you have a blog in which you'd like to use the
@@ -309,7 +314,8 @@ Available Functions
.. function:: prep_url($str = '')
:param string $str: URL string
- :returns: string
+ :returns: Protocol-prefixed URL string
+ :rtype: string
This function will add http:// in the event that a protocol prefix
is missing from a URL.
@@ -324,7 +330,7 @@ Available Functions
:param string $uri: URI string
:param string $method: Redirect method ('auto', 'location' or 'refresh')
:param string $code: HTTP Response code (usually 302 or 303)
- :returns: void
+ :rtype: void
Does a "header redirect" to the URI specified. If you specify the full
site URL that link will be built, but for local links simply providing
diff --git a/user_guide_src/source/helpers/xml_helper.rst b/user_guide_src/source/helpers/xml_helper.rst
index 7d155e192..a40ea9ad3 100644
--- a/user_guide_src/source/helpers/xml_helper.rst
+++ b/user_guide_src/source/helpers/xml_helper.rst
@@ -30,7 +30,8 @@ The following functions are available:
:param string $str: the text string to convert
:param bool $protect_all: Whether to protect all content that looks like a potential entity instead of just numbered entities, e.g. &foo;
- :returns: string
+ :returns: XML-converted string
+ :rtype: string
Takes a string as input and converts the following reserved XML
characters to entities:
@@ -51,4 +52,4 @@ The following functions are available:
.. code-block:: html
- &lt;p&gt;Here is a paragraph &amp; an entity (&#123;).&lt;/p&gt;
+ &lt;p&gt;Here is a paragraph &amp; an entity (&#123;).&lt;/p&gt; \ No newline at end of file