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/xml_helper.rst') 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/xml_helper.rst') 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/xml_helper.rst') 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/xml_helper.rst') 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/xml_helper.rst') 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 ba231aab2b26279f536a52bf4ccdb4af0d191570 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 20 Jan 2014 16:43:41 +0200 Subject: [ci skip] Replace incorrect usage of 'then', where it should be 'than' --- user_guide_src/source/helpers/xml_helper.rst | 34 ++++++++++++++-------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'user_guide_src/source/helpers/xml_helper.rst') diff --git a/user_guide_src/source/helpers/xml_helper.rst b/user_guide_src/source/helpers/xml_helper.rst index 6d26c581e..7d155e192 100644 --- a/user_guide_src/source/helpers/xml_helper.rst +++ b/user_guide_src/source/helpers/xml_helper.rst @@ -28,27 +28,27 @@ The following functions are available: .. 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; - :returns: string + :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 - Takes a string as input and converts the following reserved XML - characters to entities: + 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: - + - Ampersands: & + - Less than 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:: + 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; + $string = '

Here is a paragraph & an entity ({).

'; + $string = xml_convert($string); + echo $string; - outputs: + outputs: - .. code-block:: html + .. code-block:: html - <p>Here is a paragraph & an entity ({).</p> + <p>Here is a paragraph & an entity ({).</p> -- cgit v1.2.3-24-g4f1b From 3de130c2da3b93a3404f264e92d7b65354de3548 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 7 Feb 2014 23:31:49 +0200 Subject: [ci skip] Add return types to helper docs (+ some other formatting) --- user_guide_src/source/helpers/xml_helper.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'user_guide_src/source/helpers/xml_helper.rst') 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 - <p>Here is a paragraph & an entity ({).</p> + <p>Here is a paragraph & an entity ({).</p> \ No newline at end of file -- cgit v1.2.3-24-g4f1b