Skip to content

Commit

Permalink
Add @link to docblocks on Form, Html, Js, Paginator, Rss and Session …
Browse files Browse the repository at this point in the history
…helpers
  • Loading branch information
shama committed Nov 30, 2011
1 parent 7f68699 commit 1d50562
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/Cake/View/Helper/CacheHelper.php
Expand Up @@ -87,6 +87,7 @@ public function afterLayout($layoutFile) {
* @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;
Expand Down
8 changes: 6 additions & 2 deletions lib/Cake/View/Helper/FormHelper.php
Expand Up @@ -78,7 +78,6 @@ class FormHelper extends AppHelper {
*/
public $defaultModel = null;


/**
* Persistent default options used by input(). Set by FormHelper::create().
*
Expand Down Expand Up @@ -275,6 +274,7 @@ protected function _isRequiredField($validateProperties) {
*
* @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();
Expand Down Expand Up @@ -526,6 +526,7 @@ public function end($options = null) {
*
* @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'])) {
Expand Down Expand Up @@ -799,6 +800,7 @@ public function label($fieldName = null, $text = null, $options = array()) {
* @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;
Expand Down Expand Up @@ -1487,6 +1489,7 @@ public function button($title, $options = array()) {
* @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;'));
Expand Down Expand Up @@ -1520,6 +1523,7 @@ public function postButton($title, $url, $options = array()) {
* @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'])) {
Expand Down Expand Up @@ -1770,7 +1774,7 @@ public function select($fieldName, $options = array(), $attributes = array()) {
$select[] = $this->hidden(null, $hiddenAttributes);
}
} else {
$tag = 'selectstart';
$tag = 'selectstart';
}

if (!empty($tag) || isset($template)) {
Expand Down
5 changes: 5 additions & 0 deletions lib/Cake/View/Helper/HtmlHelper.php
Expand Up @@ -28,6 +28,7 @@
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/html.html
*/
class HtmlHelper extends AppHelper {

/**
* html tags used by this helper.
*
Expand Down Expand Up @@ -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
*
Expand Down Expand Up @@ -828,6 +831,7 @@ public function tag($name, $text = null, $options = array()) {
*
* @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])) {
Expand Down Expand Up @@ -900,6 +904,7 @@ public function para($class, $text, $options = array()) {
* @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)) {
Expand Down
2 changes: 2 additions & 0 deletions lib/Cake/View/Helper/JsHelper.php
Expand Up @@ -32,6 +32,7 @@
* @property FormHelper $Form
*/
class JsHelper extends AppHelper {

/**
* Whether or not you want scripts to be buffered or output.
*
Expand Down Expand Up @@ -323,6 +324,7 @@ public function link($title, $url = null, $options = array()) {
* @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;
Expand Down
8 changes: 8 additions & 0 deletions lib/Cake/View/Helper/PaginatorHelper.php
Expand Up @@ -117,6 +117,7 @@ public function beforeRender($viewFile) {
*
* @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)) {
Expand Down Expand Up @@ -170,6 +171,7 @@ public function options($options = array()) {
*
* @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);
Expand All @@ -187,6 +189,7 @@ public function current($model = null) {
* @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)) {
Expand All @@ -211,6 +214,7 @@ public function sortKey($model = null, $options = array()) {
* @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;
Expand Down Expand Up @@ -473,6 +477,7 @@ protected function _pagingLink($which, $title = null, $options = array(), $disab
*
* @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');
Expand All @@ -483,6 +488,7 @@ public function hasPrev($model = null) {
*
* @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');
Expand All @@ -494,6 +500,7 @@ public function hasNext($model = null) {
* @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)) {
Expand Down Expand Up @@ -525,6 +532,7 @@ protected function _hasPage($model, $page) {
* 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) {
Expand Down
6 changes: 6 additions & 0 deletions lib/Cake/View/Helper/RssHelper.php
Expand Up @@ -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) {
Expand All @@ -118,6 +119,7 @@ public function document($attrib = array(), $content = null) {
* @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)) {
Expand Down Expand Up @@ -162,6 +164,7 @@ public function channel($attrib = array(), $elements = array(), $content = null)
* @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) {
Expand All @@ -183,6 +186,7 @@ public function items($items, $callback = null) {
* @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;
Expand Down Expand Up @@ -270,6 +274,7 @@ public function item($att = array(), $elements = array()) {
* @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);
Expand All @@ -283,6 +288,7 @@ public function time($time) {
* @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;
Expand Down
1 change: 1 addition & 0 deletions lib/Cake/View/Helper/SessionHelper.php
Expand Up @@ -154,6 +154,7 @@ public function flash($key = 'flash', $attrs = array()) {
* 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();
Expand Down

0 comments on commit 1d50562

Please sign in to comment.