Browse Source

Merge pull request #342 from shama/patch-doc

Add @link to helper docblocks
José Lorenzo Rodríguez 14 years ago
parent
commit
32a3737cca

+ 1 - 0
lib/Cake/View/Helper/CacheHelper.php

@@ -87,6 +87,7 @@ class CacheHelper extends AppHelper {
  * @param string $out output to cache
  * @param boolean $cache Whether or not a cache file should be written.
  * @return string view ouput
+ * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/cache.html
  */
 	public function cache($file, $out, $cache = false) {
 		$cacheTime = 0;

+ 6 - 2
lib/Cake/View/Helper/FormHelper.php

@@ -78,7 +78,6 @@ class FormHelper extends AppHelper {
  */
 	public $defaultModel = null;
 
-
 /**
  * Persistent default options used by input(). Set by FormHelper::create().
  *
@@ -275,6 +274,7 @@ class FormHelper extends AppHelper {
  *
  * @return mixed Either false when there or no errors, or the error
  *    string. The error string could be ''.
+ * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#FormHelper::tagIsInvalid
  */
 	public function tagIsInvalid() {
 		$entity = $this->entity();
@@ -526,6 +526,7 @@ class FormHelper extends AppHelper {
  *
  * @param array $fields The list of fields to use when generating the hash
  * @return string A hidden input field with a security hash
+ * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#FormHelper::secure
  */
 	public function secure($fields = array()) {
 		if (!isset($this->request['_Token']) || empty($this->request['_Token'])) {
@@ -799,6 +800,7 @@ class FormHelper extends AppHelper {
  * @param mixed $fields An array of fields to generate inputs for, or null.
  * @param array $blacklist a simple array of fields to not create inputs for.
  * @return string Completed form inputs.
+ * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#FormHelper::inputs
  */
 	public function inputs($fields = null, $blacklist = null) {
 		$fieldset = $legend = true;
@@ -1487,6 +1489,7 @@ class FormHelper extends AppHelper {
  * @param mixed $url URL as string or array
  * @param array $options Array of options and HTML attributes.
  * @return string A HTML button tag.
+ * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#FormHelper::postButton
  */
 	public function postButton($title, $url, $options = array()) {
 		$out = $this->create(false, array('id' => false, 'url' => $url, 'style' => 'display:none;'));
@@ -1520,6 +1523,7 @@ class FormHelper extends AppHelper {
  * @param array $options Array of HTML attributes.
  * @param string $confirmMessage JavaScript confirmation message.
  * @return string An `<a />` element.
+ * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#FormHelper::postLink
  */
 	public function postLink($title, $url = null, $options = array(), $confirmMessage = false) {
 		if (!empty($options['confirm'])) {
@@ -1770,7 +1774,7 @@ class FormHelper extends AppHelper {
 				$select[] = $this->hidden(null, $hiddenAttributes);
 			}
 		} else {
- 			$tag = 'selectstart';
+			$tag = 'selectstart';
 		}
 
 		if (!empty($tag) || isset($template)) {

+ 5 - 0
lib/Cake/View/Helper/HtmlHelper.php

@@ -28,6 +28,7 @@ App::uses('AppHelper', 'View/Helper');
  * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/html.html
  */
 class HtmlHelper extends AppHelper {
+
 /**
  * html tags used by this helper.
  *
@@ -129,12 +130,14 @@ class HtmlHelper extends AppHelper {
  * @var array
  */
 	protected $_includedScripts = array();
+
 /**
  * Options for the currently opened script block buffer if any.
  *
  * @var array
  */
 	protected $_scriptBlockOptions = array();
+
 /**
  * Document type definitions
  *
@@ -828,6 +831,7 @@ class HtmlHelper extends AppHelper {
  *
  * @param string $tag Tag name
  * @return string Formatted block
+ * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/html.html#HtmlHelper::useTag
  */
 	public function useTag($tag) {
 		if (!isset($this->_tags[$tag])) {
@@ -900,6 +904,7 @@ class HtmlHelper extends AppHelper {
  * @param array $itemOptions Additional HTML attributes of the list item (LI) tag
  * @param string $tag Type of list tag to use (ol/ul)
  * @return string The nested list
+ * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/html.html#HtmlHelper::nestedList
  */
 	public function nestedList($list, $options = array(), $itemOptions = array(), $tag = 'ul') {
 		if (is_string($options)) {

+ 2 - 0
lib/Cake/View/Helper/JsHelper.php

@@ -32,6 +32,7 @@ App::uses('Multibyte', 'I18n');
  * @property      FormHelper $Form
  */
 class JsHelper extends AppHelper {
+
 /**
  * Whether or not you want scripts to be buffered or output.
  *
@@ -323,6 +324,7 @@ class JsHelper extends AppHelper {
  * @param mixed $one Either an array of variables to set, or the name of the variable to set.
  * @param mixed $two If $one is a string, $two is the value for that key.
  * @return void
+ * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/js.html#JsHelper::set
  */
 	public function set($one, $two = null) {
 		$data = null;

+ 8 - 0
lib/Cake/View/Helper/PaginatorHelper.php

@@ -117,6 +117,7 @@ class PaginatorHelper extends AppHelper {
  *
  * @param string $model Optional model name.  Uses the default if none is specified.
  * @return array The array of paging parameters for the paginated resultset.
+ * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/paginator.html#PaginatorHelper::params
  */
 	public function params($model = null) {
 		if (empty($model)) {
@@ -170,6 +171,7 @@ class PaginatorHelper extends AppHelper {
  *
  * @param string $model Optional model name.  Uses the default if none is specified.
  * @return string The current page number of the recordset.
+ * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/paginator.html#PaginatorHelper::current
  */
 	public function current($model = null) {
 		$params = $this->params($model);
@@ -187,6 +189,7 @@ class PaginatorHelper extends AppHelper {
  * @param mixed $options Options for pagination links. See #options for list of keys.
  * @return string The name of the key by which the recordset is being sorted, or
  *  null if the results are not currently sorted.
+ * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/paginator.html#PaginatorHelper::sortKey
  */
 	public function sortKey($model = null, $options = array()) {
 		if (empty($options)) {
@@ -211,6 +214,7 @@ class PaginatorHelper extends AppHelper {
  * @param mixed $options Options for pagination links. See #options for list of keys.
  * @return string The direction by which the recordset is being sorted, or
  *  null if the results are not currently sorted.
+ * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/paginator.html#PaginatorHelper::sortDir
  */
 	public function sortDir($model = null, $options = array()) {
 		$dir = null;
@@ -473,6 +477,7 @@ class PaginatorHelper extends AppHelper {
  *
  * @param string $model Optional model name. Uses the default if none is specified.
  * @return boolean True if the result set is not at the first page.
+ * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/paginator.html#PaginatorHelper::hasPrev
  */
 	public function hasPrev($model = null) {
 		return $this->_hasPage($model, 'prev');
@@ -483,6 +488,7 @@ class PaginatorHelper extends AppHelper {
  *
  * @param string $model Optional model name.  Uses the default if none is specified.
  * @return boolean True if the result set is not at the last page.
+ * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/paginator.html#PaginatorHelper::hasNext
  */
 	public function hasNext($model = null) {
 		return $this->_hasPage($model, 'next');
@@ -494,6 +500,7 @@ class PaginatorHelper extends AppHelper {
  * @param string $model Optional model name.  Uses the default if none is specified.
  * @param integer $page The page number - if not set defaults to 1.
  * @return boolean True if the given result set has the specified page number.
+ * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/paginator.html#PaginatorHelper::hasPage
  */
 	public function hasPage($model = null, $page = 1) {
 		if (is_numeric($model)) {
@@ -525,6 +532,7 @@ class PaginatorHelper extends AppHelper {
  * Gets the default model of the paged sets
  *
  * @return string Model name or null if the pagination isn't initialized.
+ * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/paginator.html#PaginatorHelper::defaultModel
  */
 	public function defaultModel() {
 		if ($this->_defaultModel != null) {

+ 6 - 0
lib/Cake/View/Helper/RssHelper.php

@@ -98,6 +98,7 @@ class RssHelper extends AppHelper {
  * @param array $attrib `<rss />` tag attributes
  * @param string $content
  * @return string An RSS document
+ * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/rss.html#RssHelper::document
  */
 	public function document($attrib = array(), $content = null) {
 		if ($content === null) {
@@ -118,6 +119,7 @@ class RssHelper extends AppHelper {
  * @param mixed $elements Named array elements which are converted to tags
  * @param mixed $content Content (`<item />`'s belonging to this channel
  * @return string An RSS `<channel />`
+ * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/rss.html#RssHelper::channel
  */
 	public function channel($attrib = array(), $elements = array(), $content = null) {
 		if (!isset($elements['title']) && !empty($this->_View->pageTitle)) {
@@ -162,6 +164,7 @@ class RssHelper extends AppHelper {
  * @param mixed $callback A string function name, or array containing an object
  *     and a string method name
  * @return string A set of RSS `<item />` elements
+ * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/rss.html#RssHelper::items
  */
 	public function items($items, $callback = null) {
 		if ($callback != null) {
@@ -183,6 +186,7 @@ class RssHelper extends AppHelper {
  * @param array $att The attributes of the `<item />` element
  * @param array $elements The list of elements contained in this `<item />`
  * @return string An RSS `<item />` element
+ * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/rss.html#RssHelper::item
  */
 	public function item($att = array(), $elements = array()) {
 		$content = null;
@@ -270,6 +274,7 @@ class RssHelper extends AppHelper {
  * @param mixed $time
  * @return string An RSS-formatted timestamp
  * @see TimeHelper::toRSS
+ * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/rss.html#RssHelper::time
  */
 	public function time($time) {
 		return $this->Time->toRSS($time);
@@ -283,6 +288,7 @@ class RssHelper extends AppHelper {
  * @param mixed $content XML element content
  * @param boolean $endTag Whether the end tag of the element should be printed
  * @return string XML
+ * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/rss.html#RssHelper::elem
  */
 	public function elem($name, $attrib = array(), $content = null, $endTag = true) {
 		$namespace = null;

+ 1 - 0
lib/Cake/View/Helper/SessionHelper.php

@@ -154,6 +154,7 @@ class SessionHelper extends AppHelper {
  * Used to check is a session is valid in a view
  *
  * @return boolean
+ * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/session.html#SessionHelper::valid
  */
 	public function valid() {
 		return CakeSession::valid();