From e7dfb679cf4f1a683d837aaea94b5b5125204779 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 19 Jul 2013 14:16:56 -0700 Subject: updating XML helper docs --- user_guide_src/source/helpers/xml_helper.rst | 42 ++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 12 deletions(-) (limited to 'user_guide_src/source/helpers') diff --git a/user_guide_src/source/helpers/xml_helper.rst b/user_guide_src/source/helpers/xml_helper.rst index be848bcd1..681408e03 100644 --- a/user_guide_src/source/helpers/xml_helper.rst +++ b/user_guide_src/source/helpers/xml_helper.rst @@ -5,7 +5,9 @@ XML Helper The XML Helper file contains functions that assist in working with XML data. -.. contents:: Page Contents + +.. contents:: + :local: Loading this Helper =================== @@ -16,23 +18,39 @@ This helper is loaded using the following code $this->load->helper('xml'); +Available Functions +=================== + The following functions are available: + xml_convert() -===================== +------------- -Takes a string as input and converts the following reserved XML -characters to entities: +.. method:: xml_convert($str[, $protect_all = FALSE]) -- Ampersands: & -- Less then and greater than characters: < > -- Single and double quotes: ' " -- Dashes: - + :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: converted string + :rtype: string -This function ignores ampersands if they are part of existing character -entities. Example + Takes a string as input and converts the following reserved XML + characters to entities: -:: + - Ampersands: & + - Less then and greater than characters: < > + - Single and double quotes: ' " + - Dashes: - + + This function ignores ampersands if they are part of existing numbered + character entities, e.g. {. Example:: + + $string = '

Here is a paragraph & an entity ({).

'; + $string = xml_convert($string); + echo $string; + + outputs: - $string = xml_convert($string); + .. code-block:: html + <p>Here is a paragraph & an entity ({).</p> -- cgit v1.2.3-24-g4f1b From 65d4f7e1d239a44c4ba39f48b1b214546c8e1536 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 19 Jul 2013 15:35:36 -0700 Subject: Adding function ToC to XML Helper --- user_guide_src/source/helpers/xml_helper.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'user_guide_src/source/helpers') diff --git a/user_guide_src/source/helpers/xml_helper.rst b/user_guide_src/source/helpers/xml_helper.rst index 681408e03..3ac6a08bb 100644 --- a/user_guide_src/source/helpers/xml_helper.rst +++ b/user_guide_src/source/helpers/xml_helper.rst @@ -9,6 +9,10 @@ data. .. contents:: :local: +.. raw:: html + +
+ Loading this Helper =================== @@ -23,10 +27,6 @@ Available Functions The following functions are available: - -xml_convert() -------------- - .. method:: xml_convert($str[, $protect_all = FALSE]) :param string $str: the text string to convert -- cgit v1.2.3-24-g4f1b From 1b9d1d2cc8ef1d6bd592fffcbbf4a575c523c97a Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 19 Jul 2013 15:36:18 -0700 Subject: whitespace in XML Helper docs --- user_guide_src/source/helpers/xml_helper.rst | 1 - 1 file changed, 1 deletion(-) (limited to 'user_guide_src/source/helpers') diff --git a/user_guide_src/source/helpers/xml_helper.rst b/user_guide_src/source/helpers/xml_helper.rst index 3ac6a08bb..881bf2db7 100644 --- a/user_guide_src/source/helpers/xml_helper.rst +++ b/user_guide_src/source/helpers/xml_helper.rst @@ -5,7 +5,6 @@ XML Helper The XML Helper file contains functions that assist in working with XML data. - .. contents:: :local: -- cgit v1.2.3-24-g4f1b From 22c9b804d53e15f6b582ee7961f9c2087fd33dbb Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 19 Jul 2013 15:38:06 -0700 Subject: simplify xml_convert method block --- user_guide_src/source/helpers/xml_helper.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'user_guide_src/source/helpers') diff --git a/user_guide_src/source/helpers/xml_helper.rst b/user_guide_src/source/helpers/xml_helper.rst index 881bf2db7..cd199095a 100644 --- a/user_guide_src/source/helpers/xml_helper.rst +++ b/user_guide_src/source/helpers/xml_helper.rst @@ -30,8 +30,7 @@ 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: converted string - :rtype: string + :returns: string Takes a string as input and converts the following reserved XML characters to entities: -- cgit v1.2.3-24-g4f1b From 261ba1cfadc13340f169556b7aeba2fd7ac2f570 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 19 Jul 2013 16:01:32 -0700 Subject: semantic correction function -> method --- user_guide_src/source/helpers/xml_helper.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'user_guide_src/source/helpers') diff --git a/user_guide_src/source/helpers/xml_helper.rst b/user_guide_src/source/helpers/xml_helper.rst index cd199095a..6d26c581e 100644 --- a/user_guide_src/source/helpers/xml_helper.rst +++ b/user_guide_src/source/helpers/xml_helper.rst @@ -26,7 +26,7 @@ Available Functions The following functions are available: -.. method:: xml_convert($str[, $protect_all = FALSE]) +.. function:: xml_convert($str[, $protect_all = FALSE]) :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; -- cgit v1.2.3-24-g4f1b From abbf518a5ec7c81bf928ced417b7670490f0f0d3 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 19 Jul 2013 16:01:52 -0700 Subject: Update URL Helper docs --- user_guide_src/source/helpers/url_helper.rst | 408 +++++++++++++-------------- 1 file changed, 195 insertions(+), 213 deletions(-) (limited to 'user_guide_src/source/helpers') diff --git a/user_guide_src/source/helpers/url_helper.rst b/user_guide_src/source/helpers/url_helper.rst index 7a49f188d..24c7e259f 100644 --- a/user_guide_src/source/helpers/url_helper.rst +++ b/user_guide_src/source/helpers/url_helper.rst @@ -4,7 +4,12 @@ URL Helper The URL Helper file contains functions that assist in working with URLs. -.. contents:: Page Contents +.. contents:: + :local: + +.. raw:: html + +
Loading this Helper =================== @@ -15,371 +20,348 @@ This helper is loaded using the following code:: The following functions are available: -site_url() -========== +Available Functions +=================== -.. php:function:: site_url($uri = '', $protocol = NULL) +.. function:: site_url([$uri = ''[, $protocol = NULL]]) :param string $uri: URI string :param string $protocol: Protocol, e.g. 'http' or 'https' :returns: 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 -file) will be added to the URL, as will any URI segments you pass to the -function, plus the **url_suffix** as set in your config file. + 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 + file) will be added to the URL, as will any URI segments you pass to the + function, plus the **url_suffix** as set in your config file. + + You are encouraged to use this function any time you need to generate a + local URL so that your pages become more portable in the event your URL + changes. -You are encouraged to use this function any time you need to generate a -local URL so that your pages become more portable in the event your URL -changes. + Segments can be optionally passed to the function as a string or an + array. Here is a string example:: -Segments can be optionally passed to the function as a string or an -array. Here is a string example:: + echo site_url('news/local/123'); - echo site_url('news/local/123'); + The above example would return something like: + *http://example.com/index.php/news/local/123* -The above example would return something like: -*http://example.com/index.php/news/local/123* + Here is an example of segments passed as an array:: -Here is an example of segments passed as an array:: + $segments = array('news', 'local', '123'); + echo site_url($segments); - $segments = array('news', 'local', '123'); - echo site_url($segments); + This function is an alias for ``CI_Config::site_url()``. For more info, + please see the :doc:`Config Library <../libraries/config>` documentation. -This function is an alias for ``CI_Config::site_url()``. For more info, -please see the :doc:`Config Library <../libraries/config>` documentation. -base_url() -=========== -.. php:function:: base_url($uri = '', $protocol = NULL) +.. function:: base_url($uri = '', $protocol = NULL) :param string $uri: URI string :param string $protocol: Protocol, e.g. 'http' or 'https' :returns: string -Returns your site base URL, as specified in your config file. Example:: + Returns your site base URL, as specified in your config file. Example:: - echo base_url(); + echo base_url(); -This function returns the same thing as :php:func:`site_url()`, without -the *index_page* or *url_suffix* being appended. + This function returns the same thing as :func:`site_url()`, without + the *index_page* or *url_suffix* being appended. -Also like :php:func:`site_url()`, you can supply segments as a string or -an array. Here is a string example:: + Also like :func:`site_url()`, you can supply segments as a string or + an array. Here is a string example:: - echo base_url("blog/post/123"); + echo base_url("blog/post/123"); -The above example would return something like: -*http://example.com/blog/post/123* + The above example would return something like: + *http://example.com/blog/post/123* -This is useful because unlike :php:func:`site_url()`, you can supply a -string to a file, such as an image or stylesheet. For example:: + This is useful because unlike :func:`site_url()`, you can supply a + string to a file, such as an image or stylesheet. For example:: - echo base_url("images/icons/edit.png"); + echo base_url("images/icons/edit.png"); -This would give you something like: -*http://example.com/images/icons/edit.png* + This would give you something like: + *http://example.com/images/icons/edit.png* -This function is an alias for ``CI_Config::base_url()``. For more info, -please see the :doc:`Config Library <../libraries/config>` documentation. + This function is an alias for ``CI_Config::base_url()``. For more info, + please see the :doc:`Config Library <../libraries/config>` documentation. -current_url() -============= -.. php:function:: current_url() +.. function:: current_url() :returns: string -Returns the full URL (including segments) of the page being currently -viewed. + Returns the full URL (including segments) of the page being currently + viewed. -.. note:: Calling this function is the same as doing this: - | - | site_url(uri_string()); + .. note:: Calling this function is the same as doing this: + | + | site_url(uri_string()); -uri_string() -============ -.. php:function:: uri_string() +.. function:: uri_string() :returns: string -Returns the URI segments of any page that contains this function. -For example, if your URL was this:: + Returns the URI segments of any page that contains this function. + For example, if your URL was this:: - http://some-site.com/blog/comments/123 + http://some-site.com/blog/comments/123 -The function would return:: + The function would return:: - blog/comments/123 + blog/comments/123 -This function is an alias for ``CI_Config::uri_string()``. For more info, -please see the :doc:`Config Library <../libraries/config>` documentation. + This function is an alias for ``CI_Config::uri_string()``. For more info, + please see the :doc:`Config Library <../libraries/config>` documentation. -index_page() -============ -.. php:function:: index_page() +.. function:: index_page() :returns: string -Returns your site **index_page**, as specified in your config file. -Example:: + Returns your site **index_page**, as specified in your config file. + Example:: - echo index_page(); + echo index_page(); -anchor() -======== -.. php:function:: anchor($uri = '', $title = '', $attributes = '') +.. function:: anchor($uri = '', $title = '', $attributes = '') :param string $uri: URI string :param string $title: Anchor title :param mixed $attributes: HTML attributes :returns: string -Creates a standard HTML anchor link based on your local site URL. + Creates a standard HTML anchor link based on your local site URL. -The first parameter can contain any segments you wish appended to the -URL. As with the :php:func:`site_url()` function above, segments can -be a string or an array. + The first parameter can contain any segments you wish appended to the + URL. As with the :func:`site_url()` function above, segments can + be a string or an array. -.. note:: If you are building links that are internal to your application - do not include the base URL (http://...). This will be added - automatically from the information specified in your config file. - Include only the URI segments you wish appended to the URL. + .. note:: If you are building links that are internal to your application + do not include the base URL (http://...). This will be added + automatically from the information specified in your config file. + Include only the URI segments you wish appended to the URL. -The second segment is the text you would like the link to say. If you -leave it blank, the URL will be used. + The second segment is the text you would like the link to say. If you + leave it blank, the URL will be used. -The third parameter can contain a list of attributes you would like -added to the link. The attributes can be a simple string or an -associative array. + The third parameter can contain a list of attributes you would like + added to the link. The attributes can be a simple string or an + associative array. -Here are some examples:: + Here are some examples:: - echo anchor('news/local/123', 'My News', 'title="News title"'); - // Prints: My News + echo anchor('news/local/123', 'My News', 'title="News title"'); + // Prints: My News - echo anchor('news/local/123', 'My News', array('title' => 'The best news!')); - // Prints: My News + echo anchor('news/local/123', 'My News', array('title' => 'The best news!')); + // Prints: My News - echo anchor('', 'Click here'); - // Prints: Click Here + echo anchor('', 'Click here'); + // Prints: Click Here -anchor_popup() -============== -.. php:function:: anchor_popup($uri = '', $title = '', $attributes = FALSE) +.. function:: anchor_popup($uri = '', $title = '', $attributes = FALSE) :param string $uri: URI string :param string $title: Anchor title :param mixed $attributes: HTML attributes :returns: string -Nearly identical to the :php:func:``anchor()`` function except that it -opens the URL in a new window. You can specify JavaScript window -attributes in the third parameter to control how the window is opened. -If the third parameter is not set it will simply open a new window with -your own browser settings. + Nearly identical to the :func:`anchor()` function except that it + opens the URL in a new window. You can specify JavaScript window + attributes in the third parameter to control how the window is opened. + If the third parameter is not set it will simply open a new window with + your own browser settings. -Here is an example with attributes:: + Here is an example with attributes:: - $atts = array( - 'width' => 800, - 'height' => 600, - 'scrollbars' => 'yes', - 'status'      => 'yes', - 'resizable'   => 'yes', - 'screenx' => 0, - 'screeny' => 0, - 'window_name' => '_blank' - ); + $atts = array( + 'width' => 800, + 'height' => 600, + 'scrollbars' => 'yes', + 'status'      => 'yes', + 'resizable'   => 'yes', + 'screenx' => 0, + 'screeny' => 0, + 'window_name' => '_blank' + ); - echo anchor_popup('news/local/123', 'Click Me!', $atts); + echo anchor_popup('news/local/123', 'Click Me!', $atts); -.. note:: The above attributes are the function defaults so you only need to - set the ones that are different from what you need. If you want the - function to use all of its defaults simply pass an empty array in the - third parameter: - | - | echo anchor_popup('news/local/123', 'Click Me!', array()); + .. note:: The above attributes are the function defaults so you only need to + set the ones that are different from what you need. If you want the + function to use all of its defaults simply pass an empty array in the + third parameter: + | + | echo anchor_popup('news/local/123', 'Click Me!', array()); -.. note:: The **window_name** is not really an attribute, but an argument to - the JavaScript `window.open() ` - method, which accepts either a window name or a window target. + .. note:: The **window_name** is not really an attribute, but an argument to + the JavaScript `window.open() ` + method, which accepts either a window name or a window target. -.. note:: Any other attribute than the listed above will be parsed as an - HTML attribute to the anchor tag. + .. note:: Any other attribute than the listed above will be parsed as an + HTML attribute to the anchor tag. -mailto() -======== -.. php:function:: mailto($email, $title = '', $attributes = '') +.. function:: mailto($email, $title = '', $attributes = '') :param string $email: E-mail address :param string $title: Anchor title :param mixed $attributes: HTML attributes :returns: string -Creates a standard HTML e-mail link. Usage example:: + Creates a standard HTML e-mail link. Usage example:: - echo mailto('me@my-site.com', 'Click Here to Contact Me'); + echo mailto('me@my-site.com', 'Click Here to Contact Me'); -As with the :php:func:`anchor()` tab above, you can set attributes using the -third parameter:: + As with the :func:`anchor()` tab above, you can set attributes using the + third parameter:: - $attributes = array('title' => 'Mail me'); - echo mailto('me@my-site.com', 'Contact Me', $attributes); + $attributes = array('title' => 'Mail me'); + echo mailto('me@my-site.com', 'Contact Me', $attributes); -safe_mailto() -============= -.. php:function:: safe_mailto($email, $title = '', $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 -Identical to the :php: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. + 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. -auto_link() -=========== -.. php:function:: auto_link($str, $type = 'both', $popup = FALSE) +.. 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 -Automatically turns URLs and e-mail addresses contained in a string into -links. Example:: + Automatically turns URLs and e-mail addresses contained in a string into + links. Example:: - $string = auto_link($string); + $string = auto_link($string); -The second parameter determines whether URLs and e-mails are converted or -just one or the other. Default behavior is both if the parameter is not -specified. E-mail links are encoded as :php:func:`safe_mailto()` as shown -above. + The second parameter determines whether URLs and e-mails are converted or + just one or the other. Default behavior is both if the parameter is not + specified. E-mail links are encoded as :func:`safe_mailto()` as shown + above. -Converts only URLs:: + Converts only URLs:: - $string = auto_link($string, 'url'); + $string = auto_link($string, 'url'); -Converts only e-mail addresses:: + Converts only e-mail addresses:: - $string = auto_link($string, 'email'); + $string = auto_link($string, 'email'); -The third parameter determines whether links are shown in a new window. -The value can be TRUE or FALSE (boolean):: + The third parameter determines whether links are shown in a new window. + The value can be TRUE or FALSE (boolean):: - $string = auto_link($string, 'both', TRUE); + $string = auto_link($string, 'both', TRUE); -url_title() -=========== -.. php:function:: url_title($str, $separator = '-', $lowercase = FALSE) +.. function:: url_title($str, $separator = '-', $lowercase = FALSE) :param string $str: Input string :param string $separator: Word separator :param string $lowercase: Whether to transform the output string to lower-case :returns: 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 -title of your entries in the URL. Example:: + 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 + title of your entries in the URL. Example:: - $title = "What's wrong with CSS?"; - $url_title = url_title($title); - // Produces: Whats-wrong-with-CSS + $title = "What's wrong with CSS?"; + $url_title = url_title($title); + // Produces: Whats-wrong-with-CSS -The second parameter determines the word delimiter. By default dashes -are used. Preferred options are: **-** (dash) or **_** (underscore) + The second parameter determines the word delimiter. By default dashes + are used. Preferred options are: **-** (dash) or **_** (underscore) -Example:: + Example:: - $title = "What's wrong with CSS?"; - $url_title = url_title($title, 'underscore'); - // Produces: Whats_wrong_with_CSS + $title = "What's wrong with CSS?"; + $url_title = url_title($title, 'underscore'); + // Produces: Whats_wrong_with_CSS -.. note:: Old usage of 'dash' and 'underscore' as the second parameter - is DEPRECATED. + .. note:: Old usage of 'dash' and 'underscore' as the second parameter + is DEPRECATED. -The third parameter determines whether or not lowercase characters are -forced. By default they are not. Options are boolean TRUE/FALSE. + The third parameter determines whether or not lowercase characters are + forced. By default they are not. Options are boolean TRUE/FALSE. -Example:: + Example:: - $title = "What's wrong with CSS?"; - $url_title = url_title($title, 'underscore', TRUE); - // Produces: whats_wrong_with_css + $title = "What's wrong with CSS?"; + $url_title = url_title($title, 'underscore', TRUE); + // Produces: whats_wrong_with_css -prep_url() ----------- -.. php:function:: prep_url($str = '') +.. function:: prep_url($str = '') :param string $str: URL string :returns: string -This function will add http:// in the event that a protocol prefix -is missing from a URL. + This function will add http:// in the event that a protocol prefix + is missing from a URL. -Pass the URL string to the function like this:: + Pass the URL string to the function like this:: - $url = prep_url('example.com'); + $url = prep_url('example.com'); -redirect() -========== -.. php:function:: redirect($uri = '', $method = 'auto', $code = NULL) +.. function:: redirect($uri = '', $method = 'auto', $code = NULL) :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 -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 -the URI segments to the controller you want to direct to will create the -link. The function will build the URL based on your config file values. + 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 + the URI segments to the controller you want to direct to will create the + link. The function will build the URL based on your config file values. -The optional second parameter allows you to force a particular redirection -method. The available methods are **auto**, **location** and **refresh**, -with location being faster but less reliable on IIS servers. -The default is **auto**, which will attempt to intelligently choose the -method based on the server environment. + The optional second parameter allows you to force a particular redirection + method. The available methods are **auto**, **location** and **refresh**, + with location being faster but less reliable on IIS servers. + The default is **auto**, which will attempt to intelligently choose the + method based on the server environment. -The optional third parameter allows you to send a specific HTTP Response -Code - this could be used for example to create 301 redirects for search -engine purposes. The default Response Code is 302. The third parameter is -*only* available with **location** redirects, and not *refresh*. Examples:: + The optional third parameter allows you to send a specific HTTP Response + Code - this could be used for example to create 301 redirects for search + engine purposes. The default Response Code is 302. The third parameter is + *only* available with **location** redirects, and not *refresh*. Examples:: - if ($logged_in == FALSE) - {       - redirect('/login/form/'); - } + if ($logged_in == FALSE) + {       + redirect('/login/form/'); + } - // with 301 redirect - redirect('/article/13', 'location', 301); + // with 301 redirect + redirect('/article/13', 'location', 301); -.. note:: In order for this function to work it must be used before anything - is outputted to the browser since it utilizes server headers. + .. note:: In order for this function to work it must be used before anything + is outputted to the browser since it utilizes server headers. -.. note:: For very fine grained control over headers, you should use the - `Output Library ` ``set_header()`` method. + .. note:: For very fine grained control over headers, you should use the + `Output Library ` ``set_header()`` method. -.. note:: To IIS users: if you hide the `Server` HTTP header, the *auto* - method won't detect IIS, in that case it is advised you explicitly - use the **refresh** method. + .. note:: To IIS users: if you hide the `Server` HTTP header, the *auto* + method won't detect IIS, in that case it is advised you explicitly + use the **refresh** method. -.. note:: When the **location** method is used, an HTTP status code of 303 - will *automatically* be selected when the page is currently accessed - via POST and HTTP/1.1 is used. + .. note:: When the **location** method is used, an HTTP status code of 303 + will *automatically* be selected when the page is currently accessed + via POST and HTTP/1.1 is used. -.. important:: This function will terminate script execution. \ No newline at end of file + .. important:: This function will terminate script execution. \ No newline at end of file -- cgit v1.2.3-24-g4f1b From b8c283a695c8074a57d8c3dfa00934312638931d Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 19 Jul 2013 16:02:53 -0700 Subject: Dropping unecessary php: directive to function definitions in user guide --- user_guide_src/source/helpers/array_helper.rst | 12 +++--- user_guide_src/source/helpers/captcha_helper.rst | 4 +- user_guide_src/source/helpers/cookie_helper.rst | 6 +-- user_guide_src/source/helpers/date_helper.rst | 28 ++++++------ user_guide_src/source/helpers/download_helper.rst | 2 +- user_guide_src/source/helpers/email_helper.rst | 4 +- user_guide_src/source/helpers/file_helper.rst | 18 ++++---- user_guide_src/source/helpers/form_helper.rst | 50 +++++++++++----------- user_guide_src/source/helpers/html_helper.rst | 18 ++++---- user_guide_src/source/helpers/inflector_helper.rst | 12 +++--- user_guide_src/source/helpers/language_helper.rst | 4 +- user_guide_src/source/helpers/number_helper.rst | 4 +- user_guide_src/source/helpers/path_helper.rst | 4 +- user_guide_src/source/helpers/security_helper.rst | 10 ++--- user_guide_src/source/helpers/smiley_helper.rst | 6 +-- user_guide_src/source/helpers/string_helper.rst | 26 +++++------ user_guide_src/source/helpers/text_helper.rst | 20 ++++----- .../source/helpers/typography_helper.rst | 6 +-- 18 files changed, 117 insertions(+), 117 deletions(-) (limited to 'user_guide_src/source/helpers') diff --git a/user_guide_src/source/helpers/array_helper.rst b/user_guide_src/source/helpers/array_helper.rst index 9435b3ac7..90ead2942 100644 --- a/user_guide_src/source/helpers/array_helper.rst +++ b/user_guide_src/source/helpers/array_helper.rst @@ -19,7 +19,7 @@ The following functions are available: element() ========= -.. php:function:: element($item, $array, $default = NULL) +.. function:: element($item, $array, $default = NULL) :param string $item: Item to fetch from the array :param array $array: Input array @@ -39,13 +39,13 @@ Example:: 'size' => '' ); - echo element('color', $array); // returns "red" - echo element('size', $array, 'foobar'); // returns "foobar" + echo element('color', $array); // returns "red" + echo element('size', $array, 'foobar'); // returns "foobar" elements() ========== -.. php:function:: elements($items, $array, $default = NULL) +.. function:: elements($items, $array, $default = NULL) :param string $item: Item to fetch from the array :param array $array: Input array @@ -55,7 +55,7 @@ elements() 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 is set to NULL, or whatever you've specified as the default value via -the third parameter. +the third parameter. Example:: @@ -106,7 +106,7 @@ updated. random_element() ================ -.. php:function:: random_element($array) +.. function:: random_element($array) :param array $array: Input array :returns: string (a random element from the array) diff --git a/user_guide_src/source/helpers/captcha_helper.rst b/user_guide_src/source/helpers/captcha_helper.rst index 3c56addf3..b40d8a252 100644 --- a/user_guide_src/source/helpers/captcha_helper.rst +++ b/user_guide_src/source/helpers/captcha_helper.rst @@ -20,7 +20,7 @@ The following functions are available: create_captcha() ================ -.. php:function:: function create_captcha($data = '', $img_path = '', $img_url = '', $font_path = '') +.. function:: function create_captcha($data = '', $img_path = '', $img_url = '', $font_path = '') :param array $data: Array of data for the CAPTCHA :param string $img_path: Path to create the image in @@ -132,7 +132,7 @@ CAPTCHA will be shown you'll have something like this:: $this->db->query($query); echo 'Submit the word you see below:'; - echo $cap['image']; + echo $cap['image']; echo ''; Then, on the page that accepts the submission you'll have something like diff --git a/user_guide_src/source/helpers/cookie_helper.rst b/user_guide_src/source/helpers/cookie_helper.rst index c41193c3c..c09f5eb4c 100644 --- a/user_guide_src/source/helpers/cookie_helper.rst +++ b/user_guide_src/source/helpers/cookie_helper.rst @@ -19,7 +19,7 @@ The following functions are available: set_cookie() ============ -.. php:function:: set_cookie($name = '', $value = '', $expire = '', $domain = '', $path = '/', $prefix = '', $secure = FALSE, $httponly = FALSE) +.. function:: set_cookie($name = '', $value = '', $expire = '', $domain = '', $path = '/', $prefix = '', $secure = FALSE, $httponly = FALSE) :param string $name: Cookie name :param string $value: Cookie value @@ -39,7 +39,7 @@ description of its use, as this function is an alias for get_cookie() ============ -.. php:function:: get_cookie($index = '', $xss_clean = FALSE) +.. function:: get_cookie($index = '', $xss_clean = FALSE) :param string $index: Cookie name :param bool $xss_clean: Whether to apply XSS filtering to the returned value @@ -52,7 +52,7 @@ description of itsuse, as this function is an alias for ``CI_Input::cookie()``. delete_cookie() =============== -.. php:function:: delete_cookie($name = '', $domain = '', $path = '/', $prefix = '') +.. function:: delete_cookie($name = '', $domain = '', $path = '/', $prefix = '') :param string $name: Cookie name :param string $domain: Cookie domain (usually: .yourdomain.com) diff --git a/user_guide_src/source/helpers/date_helper.rst b/user_guide_src/source/helpers/date_helper.rst index 5dfee8b48..67ead0330 100644 --- a/user_guide_src/source/helpers/date_helper.rst +++ b/user_guide_src/source/helpers/date_helper.rst @@ -18,7 +18,7 @@ The following functions are available: now() ===== -.. php:function:: now($timezone = NULL) +.. function:: now($timezone = NULL) :param string $timezone: Timezone :returns: int @@ -40,7 +40,7 @@ If a timezone is not provided, it will return ``time()`` based on the mdate() ======= -.. php:function:: mdate($datestr = '', $time = '') +.. function:: mdate($datestr = '', $time = '') :param string $datestr: Date string :param int $time: UNIX timestamp @@ -66,7 +66,7 @@ will be used. standard_date() =============== -.. php:function:: standard_date($fmt = 'DATE_RFC822', $time = NULL) +.. function:: standard_date($fmt = 'DATE_RFC822', $time = NULL) :param string $fmt: Date format :param int $time: UNIX timestamp @@ -109,7 +109,7 @@ DATE_W3C W3C 2005-08-14T16:13:03+0000 local_to_gmt() ============== -.. php:function:: local_to_gmt($time = '') +.. function:: local_to_gmt($time = '') :param int $time: UNIX timestamp :returns: string @@ -123,7 +123,7 @@ Example:: gmt_to_local() ============== -.. php:function:: gmt_to_local($time = '', $timezone = 'UTC', $dst = FALSE) +.. function:: gmt_to_local($time = '', $timezone = 'UTC', $dst = FALSE) :param int $time: UNIX timestamp :param string $timezone: Timezone @@ -147,7 +147,7 @@ Example:: mysql_to_unix() =============== -.. php:function:: mysql_to_unix($time = '') +.. function:: mysql_to_unix($time = '') :param int $time: UNIX timestamp :returns: int @@ -161,7 +161,7 @@ Example:: unix_to_human() =============== -.. php:function:: unix_to_human($time = '', $seconds = FALSE, $fmt = 'us') +.. function:: unix_to_human($time = '', $seconds = FALSE, $fmt = 'us') :param int $time: UNIX timestamp :param bool $seconds: Whether to show seconds @@ -190,7 +190,7 @@ Examples:: human_to_unix() =============== -.. php:function:: human_to_unix($datestr = '') +.. function:: human_to_unix($datestr = '') :param int $datestr: Date string :returns: int UNIX timestamp or FALSE on failure @@ -209,7 +209,7 @@ Example:: nice_date() =========== -.. php:function:: nice_date($bad_date = '', $format = FALSE) +.. 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) @@ -235,7 +235,7 @@ Example:: timespan() ========== -.. php:function:: timespan($seconds = 1, $time = '', $units = '') +.. function:: timespan($seconds = 1, $time = '', $units = '') :param int $seconds: Number of seconds :param string $time: UNIX timestamp @@ -269,7 +269,7 @@ Example:: days_in_month() =============== -.. php:function:: days_in_month($month = 0, $year = '') +.. function:: days_in_month($month = 0, $year = '') :param int $month: a numeric month :param int $year: a numeric year @@ -287,7 +287,7 @@ If the second parameter is empty, the current year will be used. date_range() ============ -.. php:function:: date_range($unix_start = '', $mixed = '', $is_unix = TRUE, $format = 'Y-m-d') +.. 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 @@ -309,7 +309,7 @@ Example:: timezones() =========== -.. php:function:: timezones($tz = '') +.. function:: timezones($tz = '') :param string $tz: a numeric timezone :returns: string @@ -328,7 +328,7 @@ This function is useful when used with :php:func:`timezone_menu()`. timezone_menu() =============== -.. php:function:: timezone_menu($default = 'UTC', $class = '', $name = 'timezones', $attributes = '') +.. function:: timezone_menu($default = 'UTC', $class = '', $name = 'timezones', $attributes = '') :param string $default: Timezone :param string $class: Class name diff --git a/user_guide_src/source/helpers/download_helper.rst b/user_guide_src/source/helpers/download_helper.rst index 860c568b9..fd95f4f34 100644 --- a/user_guide_src/source/helpers/download_helper.rst +++ b/user_guide_src/source/helpers/download_helper.rst @@ -18,7 +18,7 @@ The following functions are available: force_download() ================ -.. php:function:: force_download($filename = '', $data = '', $set_mime = FALSE) +.. function:: force_download($filename = '', $data = '', $set_mime = FALSE) :param string $filename: Filename :param mixed $data: File contents diff --git a/user_guide_src/source/helpers/email_helper.rst b/user_guide_src/source/helpers/email_helper.rst index 10adf1d0e..b38e7ec46 100644 --- a/user_guide_src/source/helpers/email_helper.rst +++ b/user_guide_src/source/helpers/email_helper.rst @@ -22,7 +22,7 @@ The following functions are available: valid_email() ============= -.. php:function:: valid_email($email) +.. function:: valid_email($email) :param string $email: Email address :returns: bool @@ -49,7 +49,7 @@ Example:: send_email() ============ -.. php:function:: send_email($recipient, $subject, $message) +.. function:: send_email($recipient, $subject, $message) :param string $recipient: E-mail address :param string $subject: Mail subject diff --git a/user_guide_src/source/helpers/file_helper.rst b/user_guide_src/source/helpers/file_helper.rst index 194d4348f..be451db4d 100644 --- a/user_guide_src/source/helpers/file_helper.rst +++ b/user_guide_src/source/helpers/file_helper.rst @@ -18,7 +18,7 @@ The following functions are available: read_file() =========== -.. php:function:: read_file($file) +.. function:: read_file($file) :param string $file: File path :returns: string or FALSE on failure @@ -45,7 +45,7 @@ The path can be a relative or full server path. Returns FALSE (boolean) on failu write_file() ============ -.. php:function:: write_file($path, $data, $mode = 'wb') +.. function:: write_file($path, $data, $mode = 'wb') :param string $path: File path :param string $data: Data to write to file @@ -87,7 +87,7 @@ for mode options. delete_files() ============== -.. php:function:: delete_files($path, $del_dir = FALSE, $htdocs = FALSE) +.. function:: delete_files($path, $del_dir = FALSE, $htdocs = FALSE) :param string $path: Directory path :param bool $del_dir: Whether to also delete directories @@ -112,7 +112,7 @@ Example:: get_filenames() =============== -.. php:function:: get_filenames($source_dir, $include_path = FALSE) +.. 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 @@ -129,7 +129,7 @@ Example:: get_dir_file_info() =================== -.. php:function:: get_dir_file_info($source_dir, $top_level_only) +.. 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 @@ -148,7 +148,7 @@ Example:: get_file_info() =============== -.. php:function: get_file_info($file, $returned_values = array('name', 'server_path', 'size', 'date')) +.. 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 @@ -168,7 +168,7 @@ Valid ``$returned_values`` options are: `name`, `size`, `date`, `readable`, `wri get_mime_by_extension() ======================= -.. php:function:: get_mime_by_extension($filename) +.. function:: get_mime_by_extension($filename) :param string $filename: File name :returns: string or FALSE on failure @@ -188,7 +188,7 @@ Returns FALSE if it can't determine the type, or read the MIME config file. symbolic_permissions() ====================== -.. php:function:: symbolic_permissions($perms) +.. function:: symbolic_permissions($perms) :param int $perms: Permissions :returns: string @@ -203,7 +203,7 @@ standard symbolic notation of file permissions. octal_permissions() =================== -.. php:function:: octal_permissions($perms) +.. function:: octal_permissions($perms) :param int $perms: Permissions :returns: string diff --git a/user_guide_src/source/helpers/form_helper.rst b/user_guide_src/source/helpers/form_helper.rst index b2a9b6f0f..e88a5de87 100644 --- a/user_guide_src/source/helpers/form_helper.rst +++ b/user_guide_src/source/helpers/form_helper.rst @@ -19,7 +19,7 @@ The following functions are available: form_open() =========== -.. php:function:: form_open($action = '', $attributes = '', $hidden = array()) +.. function:: form_open($action = '', $attributes = '', $hidden = array()) :param string $action: Form action/target URI string :param string $attributes: HTML attributes @@ -74,7 +74,7 @@ The above example would create a form similar to this:: form_open_multipart() ===================== -.. php:function:: form_open_multipart($action = '', $attributes = array(), $hidden = array()) +.. function:: form_open_multipart($action = '', $attributes = array(), $hidden = array()) :param string $action: Form action/target URI string :param string $attributes: HTML attributes @@ -88,7 +88,7 @@ would like to use the form to upload files with. form_hidden() ============= -.. php:function:: form_hidden($name, $value = '') +.. function:: form_hidden($name, $value = '') :param string $name: Field name :param string $value: Field value @@ -156,7 +156,7 @@ If you want to create hidden input fields with extra attributes:: form_input() ============ -.. php:function:: form_input($data = '', $value = '', $extra = '') +.. function:: form_input($data = '', $value = '', $extra = '') :param array $data: Field attributes data :param string $value: Field value @@ -197,7 +197,7 @@ JavaScript, you can pass it as a string in the third parameter:: form_password() =============== -.. php:function:: form_password($data = '', $value = '', $extra = '') +.. function:: form_password($data = '', $value = '', $extra = '') :param array $data: Field attributes data :param string $value: Field value @@ -210,7 +210,7 @@ function above except that it uses the "password" input type. form_upload() ============= -.. php:function:: form_upload($data = '', $value = '', $extra = '') +.. function:: form_upload($data = '', $value = '', $extra = '') :param array $data: Field attributes data :param string $value: Field value @@ -224,7 +224,7 @@ be used to upload files. form_textarea() =============== -.. php:function:: form_textarea($data = '', $value = '', $extra = '') +.. function:: form_textarea($data = '', $value = '', $extra = '') :param array $data: Field attributes data :param string $value: Field value @@ -240,7 +240,7 @@ function above except that it generates a "textarea" type. form_dropdown() =============== -.. php:function:: form_dropdown($name = '', $options = array(), $selected = array(), $extra = '') +.. 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 @@ -305,7 +305,7 @@ label. form_multiselect() ================== -.. php:function:: form_multiselect($name = '', $options = array(), $selected = array(), $extra = '') +.. function:: form_multiselect($name = '', $options = array(), $selected = array(), $extra = '') :param string $name: Field name :param array $options: An associative array of options to be listed @@ -325,7 +325,7 @@ syntax, e.g. foo[]. form_fieldset() =============== -.. php:function:: form_fieldset($legend_text = '', $attributes = array()) +.. function:: form_fieldset($legend_text = '', $attributes = array()) :param string $legend_text: Text to put in the tag :param array $attributes: Attributes to be set on the
tag @@ -372,7 +372,7 @@ second parameter if you prefer to set additional attributes:: form_fieldset_close() ===================== -.. php:function:: form_fieldset_close($extra = '') +.. function:: form_fieldset_close($extra = '') :param string $extra: Anything to append after the closing tag, *as is* :returns: string @@ -390,7 +390,7 @@ the tag. For example form_checkbox() =============== -.. php:function:: form_checkbox($data = '', $value = '', $checked = FALSE, $extra = '') +.. function:: form_checkbox($data = '', $value = '', $checked = FALSE, $extra = '') :param array $data: Field attributes data :param string $value: Field value @@ -432,7 +432,7 @@ fourth parameter:: form_radio() ============ -.. php:function:: form_radio($data = '', $value = '', $checked = FALSE, $extra = '') +.. function:: form_radio($data = '', $value = '', $checked = FALSE, $extra = '') :param array $data: Field attributes data :param string $value: Field value @@ -446,7 +446,7 @@ function above except that it uses the "radio" input type. form_label() ============ -.. php:function:: form_label($label_text = '', $id = '', $attributes = array()) +.. function:: form_label($label_text = '', $id = '', $attributes = array()) :param string $label_text: Text to put in the