Fixed some API doc in views.

This commit is contained in:
Juan Basso 2011-07-28 22:45:47 -04:00
parent a0ee8b49fe
commit 02f290ac52
17 changed files with 64 additions and 47 deletions

View file

@ -149,6 +149,7 @@ class Helper extends Object {
*
* @param string $method Method to invoke
* @param array $params Array of params for the method.
* @return void
*/
public function __call($method, $params) {
trigger_error(__d('cake_dev', 'Method %1$s::%2$s does not exist', get_class($this), $method), E_USER_WARNING);
@ -184,7 +185,9 @@ class Helper extends Object {
/**
* Provides backwards compatiblity access for setting values to the request object.
*
* @return void
* @param string $name Name of the property being accessed.
* @param mixed $value
* @return mixed Return the $value
*/
public function __set($name, $value) {
switch ($name) {
@ -379,6 +382,7 @@ class Helper extends Object {
*
* @param string $key The name of the attribute to create
* @param string $value The value of the attribute to create.
* @param boolean $escape Define if the value must be escaped
* @return string The composed attribute.
*/
protected function _formatAttribute($key, $value, $escape = true) {

View file

@ -49,6 +49,7 @@ class CacheHelper extends AppHelper {
/**
* Parses the view file and stores content for cache file building.
*
* @param string $viewFile
* @return void
*/
public function afterRender($viewFile) {
@ -61,6 +62,7 @@ class CacheHelper extends AppHelper {
/**
* Parses the layout file and stores content for cache file building.
*
* @param string $layoutFile
* @return void
*/
public function afterLayout($layoutFile) {
@ -134,6 +136,7 @@ class CacheHelper extends AppHelper {
*
* @param string $file The filename that needs to be parsed.
* @param string $cache The cached content
* @return void
*/
protected function _parseFile($file, $cache) {
if (is_file($file)) {
@ -205,6 +208,7 @@ class CacheHelper extends AppHelper {
*
* @param string $content view content to write to a cache file.
* @param sting $timestamp Duration to set for cache file.
* @param boolean $useCallbacks
* @return boolean success of caching view.
*/
protected function _writeFile($content, $timestamp, $useCallbacks = false) {

View file

@ -139,6 +139,7 @@ class FormHelper extends AppHelper {
* Guess the location for a model based on its name and tries to create a new instance
* or get an already created instance of the model
*
* @param string $model
* @return Model model instance
*/
protected function _getModel($model) {
@ -251,6 +252,7 @@ class FormHelper extends AppHelper {
/**
* Returns if a field is required to be filled based on validation properties from the validating object
*
* @param array $validateProperties
* @return boolean true if field is required to be filled, false otherwise
*/
protected function _isRequiredField($validateProperties) {
@ -1117,6 +1119,8 @@ class FormHelper extends AppHelper {
/**
* Generate a label for an input() call.
*
* @param string $fieldName
* @param string $label
* @param array $options Options for the label element.
* @return string Generated label element
*/
@ -1992,7 +1996,6 @@ class FormHelper extends AppHelper {
*
* @param string $fieldName Prefix name for the SELECT element
* @param string $attributes Array of Attributes
* @param bool $showEmpty Show/Hide an empty option
* @return string Completed meridian select input
* @access public
* @link http://book.cakephp.org/view/1422/meridian
@ -2216,6 +2219,7 @@ class FormHelper extends AppHelper {
* Gets the input field name for the current tag
*
* @param array $options
* @param string $field
* @param string $key
* @return array
*/
@ -2256,7 +2260,11 @@ class FormHelper extends AppHelper {
/**
* Returns an array of formatted OPTION/OPTGROUP elements
* @access private
*
* @param array $elements
* @param array $parents
* @param boolean $showParents
* @param array $attributes
* @return array
*/
function __selectOptions($elements = array(), $parents = array(), $showParents = null, $attributes = array()) {
@ -2347,7 +2355,10 @@ class FormHelper extends AppHelper {
/**
* Generates option lists for common <select /> menus
* @access private
*
* @param string $name
* @param array $options
* @return array
*/
function __generateOptions($name, $options = array()) {
if (!empty($this->options[$name])) {

View file

@ -1040,6 +1040,7 @@ class HtmlHelper extends AppHelper {
*
* @param string $key The name of the attribute to create
* @param string $value The value of the attribute to create.
* @param boolean $escape Define if the value must be escaped
* @return string The composed attribute.
*/
protected function _formatAttribute($key, $value, $escape = true) {

View file

@ -108,18 +108,16 @@ class JqueryEngineHelper extends JsBaseEngineHelper {
* when jQuery is put into noConflict() mode.
*
* @var string
* @access public
*/
public $jQueryObject = '$';
public $jQueryObject = '$';
/**
* Helper function to wrap repetitive simple method templating.
*
* @param string $method The method name being generated.
* @param string $template The method template
* @param string $selection the selection to apply
* @param string $options Array of options for method
* @param string $callbacks Array of callback / special options.
* @param array $options Array of options for method
* @param array $extraSafeKeys Extra safe keys
* @return string Composed method string
*/
protected function _methodTemplate($method, $template, $options, $extraSafeKeys = array()) {
@ -193,7 +191,6 @@ class JqueryEngineHelper extends JsBaseEngineHelper {
/**
* Create an iteration over the current selection result.
*
* @param string $method The method you want to apply to the selection
* @param string $callback The function body you wish to apply during the iteration.
* @return string completed iteration
*/

View file

@ -32,7 +32,6 @@ abstract class JsBaseEngineHelper extends AppHelper {
* The js snippet for the current selection.
*
* @var string
* @access public
*/
public $selection;
@ -42,7 +41,6 @@ abstract class JsBaseEngineHelper extends AppHelper {
* for end user use though.
*
* @var array
* @access protected
*/
protected $_optionMap = array();
@ -51,7 +49,6 @@ abstract class JsBaseEngineHelper extends AppHelper {
* This allows specific 'end point' methods to be automatically buffered by the JsHelper.
*
* @var array
* @access public
*/
public $bufferedMethods = array('event', 'sortable', 'drag', 'drop', 'slider');
@ -59,13 +56,14 @@ abstract class JsBaseEngineHelper extends AppHelper {
* Contains a list of callback names -> default arguments.
*
* @var array
* @access protected
*/
protected $_callbackArguments = array();
/**
* Constructor.
*
* @param View $View
* @param array $settings
*/
function __construct($View, $settings = array()) {
parent::__construct($View, $settings);
@ -153,7 +151,7 @@ abstract class JsBaseEngineHelper extends AppHelper {
* Converts a PHP-native variable of any type to a JSON-equivalent representation
*
* @param mixed $val A PHP variable to be converted to JSON
* @param boolean $quoteStrings If false, leaves string values unquoted
* @param boolean $quoteString If false, leaves string values unquoted
* @return string a JavaScript-safe/JSON representation of $val
*/
public function value($val, $quoteString = true) {
@ -192,7 +190,7 @@ abstract class JsBaseEngineHelper extends AppHelper {
* - "\n" => '\n'
* - '"' => '\"'
*
* @param string $script String that needs to get escaped.
* @param string $string String that needs to get escaped.
* @return string Escaped string.
*/
public function escape($string) {
@ -421,6 +419,7 @@ abstract class JsBaseEngineHelper extends AppHelper {
* - `hover` - Event fired when a drag enters a drop zone.
* - `leave` - Event fired when a drag is removed from a drop zone without being dropped.
*
* @param array $options Array of options for the drop. See above.
* @return string Completed drop script
*/
abstract public function drop($options = array());
@ -466,6 +465,7 @@ abstract class JsBaseEngineHelper extends AppHelper {
* - `change` - Fired when the slider's value is updated
* - `complete` - Fired when the user stops sliding the handle
*
* @param array $options Array of options for the slider. See above.
* @return string Completed slider script
*/
abstract public function slider($options = array());

View file

@ -161,7 +161,7 @@ class JsHelper extends AppHelper {
* See JsBaseEngineHelper::value() for more information on this method.
*
* @param mixed $val A PHP variable to be converted to JSON
* @param boolean $quoteStrings If false, leaves string values unquoted
* @param boolean $quoteString If false, leaves string values unquoted
* @return string a JavaScript-safe/JSON representation of $val
* @access public
**/
@ -354,7 +354,7 @@ class JsHelper extends AppHelper {
* - `buffer` Whether or not you wish the script code to be buffered, defaults to true.
* - Also see options for JsHelper::request() and JsHelper::event()
*
* @param string $title The display text of the submit button.
* @param string $caption The display text of the submit button.
* @param array $options Array of options to use. See the options for the above mentioned methods.
* @return string Completed submit button.
*/

View file

@ -174,7 +174,6 @@ class MootoolsEngineHelper extends JsBaseEngineHelper {
/**
* Create an iteration over the current selection result.
*
* @param string $method The method you want to apply to the selection
* @param string $callback The function body you wish to apply during the iteration.
* @return string completed iteration
*/

View file

@ -80,9 +80,8 @@ class NumberHelper extends AppHelper {
/**
* Returns a formatted-for-humans file size.
*
* @param integer $length Size in bytes
* @param integer $size Size in bytes
* @return string Human readable size
* @access public
* @link http://book.cakephp.org/view/1456/toReadableSize
*/
public function toReadableSize($size) {

View file

@ -111,6 +111,7 @@ class PaginatorHelper extends AppHelper {
/**
* Before render callback. Overridden to merge passed args with url options.
*
* @param string $viewFile
* @return void
*/
public function beforeRender($viewFile) {
@ -246,10 +247,10 @@ class PaginatorHelper extends AppHelper {
* - `escape` Whether you want the contents html entity encoded, defaults to true
* - `model` The model to use, defaults to PaginatorHelper::defaultModel()
*
* @param string $title Title for the link. Defaults to '<< Previous'.
* @param mixed $options Options for pagination link. See #options for list of keys.
* @param string $disabledTitle Title when the link is disabled.
* @param mixed $disabledOptions Options for the disabled pagination link. See #options for list of keys.
* @param string $title Title for the link. Defaults to '<< Previous'.
* @param array $options Options for pagination link. See #options for list of keys.
* @param string $disabledTitle Title when the link is disabled.
* @param array $disabledOptions Options for the disabled pagination link. See #options for list of keys.
* @return string A "previous" link or $disabledTitle text if the link is disabled.
*/
public function prev($title = '<< Previous', $options = array(), $disabledTitle = null, $disabledOptions = array()) {
@ -403,6 +404,7 @@ class PaginatorHelper extends AppHelper {
* Converts the keys being used into the format set by options.paramType
*
* @param array $url Array of url params to convert
* @param string $type
* @return converted url params.
*/
protected function _convertUrlKeys($url, $type) {
@ -424,6 +426,12 @@ class PaginatorHelper extends AppHelper {
/**
* Protected method for generating prev/next links
*
* @param string $which
* @param string $title
* @param array $options
* @param string $disabledTitle
* @param array $disabledOptions
* @return string
*/
protected function __pagingLink($which, $title = null, $options = array(), $disabledTitle = null, $disabledOptions = array()) {
$check = 'has' . $which;

View file

@ -165,7 +165,6 @@ class PrototypeEngineHelper extends JsBaseEngineHelper {
/**
* Create an iteration over the current selection result.
*
* @param string $method The method you want to apply to the selection
* @param string $callback The function body you wish to apply during the iteration.
* @return string completed iteration
*/

View file

@ -104,6 +104,7 @@ class RssHelper extends AppHelper {
* Returns an RSS document wrapped in `<rss />` tags
*
* @param array $attrib `<rss />` tag attributes
* @param string $content
* @return string An RSS document
*/
public function document($attrib = array(), $content = null) {
@ -187,7 +188,7 @@ class RssHelper extends AppHelper {
/**
* Converts an array into an `<item />` element and its contents
*
* @param array $attrib The attributes of the `<item />` element
* @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
*/

View file

@ -101,9 +101,9 @@ class SessionHelper extends AppHelper {
* }}}
*
* @param string $key The [Message.]key you are rendering in the view.
* @return array $attrs Additional attributes to use for the creation of this flash message.
* @param array $attrs Additional attributes to use for the creation of this flash message.
* Supports the 'params', and 'element' keys that are used in the helper.
* @access public
* @return string
* @link http://book.cakephp.org/view/1466/Methods
* @link http://book.cakephp.org/view/1467/flash
*/

View file

@ -114,9 +114,8 @@ class TextHelper extends AppHelper {
* strings like http:// and ftp://.
*
* @param string $text Text to add links to
* @param array $options Array of HTML options.
* @param array $htmlOptions Array of HTML options.
* @return string The text with links
* @access public
* @link http://book.cakephp.org/view/1469/Text#autoLinkUrls-1619
*/
public function autoLinkUrls($text, $htmlOptions = array()) {
@ -210,11 +209,10 @@ class TextHelper extends AppHelper {
* - `exact` If false, $text will not be cut mid-word
* - `html` If true, HTML tags would be handled correctly
*
* @param string $text String to truncate.
* @param string $text String to truncate.
* @param integer $length Length of returned string, including ellipsis.
* @param array $options An array of html attributes and options.
* @return string Trimmed string.
* @access public
* @link http://book.cakephp.org/view/1469/Text#truncate-1625
*/
public function truncate($text, $length = 100, $options = array()) {

View file

@ -60,7 +60,7 @@ class TimeHelper extends AppHelper {
*
* @param string $format Format with specifiers for strftime function.
* Accepts the special specifier %S which mimics th modifier S for date()
* @param string UNIX timestamp
* @param string $time UNIX timestamp
* @return string windows safe and date() function compatible format for strftime
*/
public function convertSpecifiers($format, $time = null) {
@ -279,7 +279,7 @@ class TimeHelper extends AppHelper {
/**
* Returns a partial SQL string to search for all records between two dates.
*
* @param string $dateString Datetime string or Unix timestamp
* @param string $begin Datetime string or Unix timestamp
* @param string $end Datetime string or Unix timestamp
* @param string $fieldName Name of database field to compare with
* @param int $userOffset User's offset from GMT (in hours)
@ -343,7 +343,6 @@ class TimeHelper extends AppHelper {
* @param string $dateString
* @param int $userOffset User's offset from GMT (in hours)
* @return boolean True if datetime string is within current month
* @access public
* @link http://book.cakephp.org/view/1472/Testing-Time
*/
public function isThisMonth($dateString, $userOffset = null) {
@ -355,8 +354,8 @@ class TimeHelper extends AppHelper {
* Returns true if given datetime string is within current year.
*
* @param string $dateString Datetime string or Unix timestamp
* @param integer $userOffset User's offset from GMT (in hours)
* @return boolean True if datetime string is within current year
* @access public
* @link http://book.cakephp.org/view/1472/Testing-Time
*/
public function isThisYear($dateString, $userOffset = null) {
@ -370,7 +369,6 @@ class TimeHelper extends AppHelper {
* @param string $dateString Datetime string or Unix timestamp
* @param int $userOffset User's offset from GMT (in hours)
* @return boolean True if datetime string was yesterday
* @access public
* @link http://book.cakephp.org/view/1472/Testing-Time
*
*/
@ -385,7 +383,6 @@ class TimeHelper extends AppHelper {
* @param string $dateString Datetime string or Unix timestamp
* @param int $userOffset User's offset from GMT (in hours)
* @return boolean True if datetime string was yesterday
* @access public
* @link http://book.cakephp.org/view/1472/Testing-Time
*/
public function isTomorrow($dateString, $userOffset = null) {
@ -399,7 +396,6 @@ class TimeHelper extends AppHelper {
* @param string $dateString
* @param boolean $range if true returns a range in Y-m-d format
* @return boolean True if datetime string is within current week
* @access public
* @link http://book.cakephp.org/view/1471/Formatting
*/
public function toQuarter($dateString, $range = false) {
@ -492,10 +488,9 @@ class TimeHelper extends AppHelper {
* The returned string includes 'ago' or 'on' and assumes you'll properly add a word
* like 'Posted ' before the function output.
*
* @param string $dateString Datetime string or Unix timestamp
* @param string $dateTime Datetime string or Unix timestamp
* @param array $options Default format if timestamp is used in $dateString
* @return string Relative time string.
* @access public
* @link http://book.cakephp.org/view/1471/Formatting
*/
public function timeAgoInWords($dateTime, $options = array()) {
@ -684,9 +679,8 @@ class TimeHelper extends AppHelper {
/**
* Returns gmt, given either a UNIX timestamp or a valid strtotime() date string.
*
* @param string $dateString Datetime string
* @param string $string Datetime string
* @return string Formatted date string
* @access public
* @link http://book.cakephp.org/view/1471/Formatting
*/
public function gmt($string = null) {
@ -712,9 +706,9 @@ class TimeHelper extends AppHelper {
* In that case this function behaves as a wrapper for TimeHelper::i18nFormat()
*
* @param string $format date format string (or a DateTime string)
* @param string $dateString Datetime string (or a date format string)
* @param string $date Datetime string (or a date format string)
* @param boolean $invalid flag to ignore results of fromString == false
* @param int $userOffset User's offset from GMT (in hours)
* @param integer $userOffset User's offset from GMT (in hours)
* @return string Formatted date string
*/
public function format($format, $date = null, $invalid = false, $userOffset = null) {
@ -735,7 +729,7 @@ class TimeHelper extends AppHelper {
* Returns a formatted date string, given either a UNIX timestamp or a valid strtotime() date string.
* It take in account the default date format for the current language if a LC_TIME file is used.
*
* @param string $dateString Datetime string
* @param string $date Datetime string
* @param string $format strftime format string.
* @param boolean $invalid flag to ignore results of fromString == false
* @param int $userOffset User's offset from GMT (in hours)

View file

@ -30,6 +30,7 @@ class HelperCollection extends ObjectCollection {
/**
* Constructor
*
* @param View $view
* @return void
*/
public function __construct(View $view) {

View file

@ -377,6 +377,7 @@ class View extends Object {
* - `scripts_for_layout` - contains scripts added to header
*
* @param string $content_for_layout Content to render in a view, wrapped by the surrounding layout.
* @param string $layout Layout name
* @return mixed Rendered output, or false on error
* @throws CakeException if there is an error in the view.
*/