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/captcha_helper.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'user_guide_src/source/helpers/captcha_helper.rst') 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 -- cgit v1.2.3-24-g4f1b From 333ad2e25052ae741e523b1396892f96f8ec6a32 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 19 Jul 2013 17:03:25 -0700 Subject: Update CAPTCHA helper docs --- user_guide_src/source/helpers/captcha_helper.rst | 86 +++++++++++++----------- 1 file changed, 45 insertions(+), 41 deletions(-) (limited to 'user_guide_src/source/helpers/captcha_helper.rst') diff --git a/user_guide_src/source/helpers/captcha_helper.rst b/user_guide_src/source/helpers/captcha_helper.rst index b40d8a252..13cf92a19 100644 --- a/user_guide_src/source/helpers/captcha_helper.rst +++ b/user_guide_src/source/helpers/captcha_helper.rst @@ -5,55 +5,24 @@ CAPTCHA Helper The CAPTCHA Helper file contains functions that assist in creating CAPTCHA images. -.. contents:: Page Contents +.. contents:: + :local: + +.. raw:: html + +
Loading this Helper =================== -This helper is loaded using the following code -:: +This helper is loaded using the following code:: $this->load->helper('captcha'); -The following functions are available: - -create_captcha() -================ - -.. 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 - :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) - -Takes an array of information to generate the CAPTCHA as input and -creates the image to your specifications, returning an array of -associative data about the image. - -:: - - array( - 'image' => IMAGE TAG - 'time' => TIMESTAMP (in microtime) - 'word' => CAPTCHA WORD - ) - -The **image** is the actual image tag:: - - - -The **time** is the micro timestamp used as the image name without the -file extension. It will be a number like this: 1139612155.3422 - -The **word** is the word that appears in the captcha image, which if not -supplied to the function, will be a random string. - Using the CAPTCHA helper ------------------------- +======================== -Once loaded you can generate a captcha like this:: +Once loaded you can generate a CAPTCHA like this:: $vals = array( 'word' => 'Random word', @@ -152,4 +121,39 @@ this:: if ($row->count == 0) {      echo 'You must submit the word that appears in the image.'; - } \ No newline at end of file + } + +Available Functions +=================== + +The following functions are available: + +.. 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 + :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) + + Takes an array of information to generate the CAPTCHA as input and + creates the image to your specifications, returning an array of + associative data about the image. + + :: + + array( + 'image' => IMAGE TAG + 'time' => TIMESTAMP (in microtime) + 'word' => CAPTCHA WORD + ) + + The **image** is the actual image tag:: + + + + The **time** is the micro timestamp used as the image name without the + file extension. It will be a number like this: 1139612155.3422 + + The **word** is the word that appears in the captcha image, which if not + supplied to the function, will be a random string. \ No newline at end of file -- 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/captcha_helper.rst | 1 + 1 file changed, 1 insertion(+) (limited to 'user_guide_src/source/helpers/captcha_helper.rst') 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 -- cgit v1.2.3-24-g4f1b