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') 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