|
|
@@ -28,7 +28,7 @@ App::uses('AppHelper', 'View/Helper');
|
|
|
*
|
|
|
* @package Cake.View.Helper
|
|
|
* @property HtmlHelper $Html
|
|
|
- * @link http://book.cakephp.org/view/1383/Form
|
|
|
+ * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html
|
|
|
*/
|
|
|
class FormHelper extends AppHelper {
|
|
|
|
|
|
@@ -312,7 +312,7 @@ class FormHelper extends AppHelper {
|
|
|
* @param string $model The model object which the form is being defined for
|
|
|
* @param array $options An array of html attributes and options.
|
|
|
* @return string An formatted opening FORM tag.
|
|
|
- * @link http://book.cakephp.org/view/1384/Creating-Forms
|
|
|
+ * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#options-for-create
|
|
|
*/
|
|
|
public function create($model = null, $options = array()) {
|
|
|
$created = $id = false;
|
|
|
@@ -487,7 +487,7 @@ class FormHelper extends AppHelper {
|
|
|
*
|
|
|
* @param mixed $options as a string will use $options as the value of button,
|
|
|
* @return string a closing FORM tag optional submit button.
|
|
|
- * @link http://book.cakephp.org/view/1389/Closing-the-Form
|
|
|
+ * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#closing-the-form
|
|
|
*/
|
|
|
public function end($options = null) {
|
|
|
$out = null;
|
|
|
@@ -628,7 +628,7 @@ class FormHelper extends AppHelper {
|
|
|
*
|
|
|
* @param string $field This should be "Modelname.fieldname"
|
|
|
* @return boolean If there are errors this method returns true, else false.
|
|
|
- * @link http://book.cakephp.org/view/1426/isFieldError
|
|
|
+ * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#FormHelper::isFieldError
|
|
|
*/
|
|
|
public function isFieldError($field) {
|
|
|
$this->setEntity($field);
|
|
|
@@ -650,7 +650,7 @@ class FormHelper extends AppHelper {
|
|
|
* If array contains `attributes` key it will be used as options for error container
|
|
|
* @param array $options Rendering options for <div /> wrapper tag
|
|
|
* @return string If there are errors this method returns an error message, otherwise null.
|
|
|
- * @link http://book.cakephp.org/view/1423/error
|
|
|
+ * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#FormHelper::error
|
|
|
*/
|
|
|
public function error($field, $text = null, $options = array()) {
|
|
|
$defaults = array('wrap' => true, 'class' => 'error-message', 'escape' => true);
|
|
|
@@ -735,7 +735,7 @@ class FormHelper extends AppHelper {
|
|
|
* @param string $text Text that will appear in the label field.
|
|
|
* @param mixed $options An array of HTML attributes, or a string, to be used as a class name.
|
|
|
* @return string The formatted LABEL element
|
|
|
- * @link http://book.cakephp.org/view/1427/label
|
|
|
+ * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#FormHelper::label
|
|
|
*/
|
|
|
public function label($fieldName = null, $text = null, $options = array()) {
|
|
|
if (empty($fieldName)) {
|
|
|
@@ -894,7 +894,7 @@ class FormHelper extends AppHelper {
|
|
|
* @param string $fieldName This should be "Modelname.fieldname"
|
|
|
* @param array $options Each type of input takes different options.
|
|
|
* @return string Completed form widget.
|
|
|
- * @link http://book.cakephp.org/view/1390/Automagic-Form-Elements
|
|
|
+ * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#creating-form-elements
|
|
|
*/
|
|
|
public function input($fieldName, $options = array()) {
|
|
|
$this->setEntity($fieldName);
|
|
|
@@ -1197,7 +1197,7 @@ class FormHelper extends AppHelper {
|
|
|
* @param string $fieldName Name of a field, like this "Modelname.fieldname"
|
|
|
* @param array $options Array of HTML attributes.
|
|
|
* @return string An HTML text input element.
|
|
|
- * @link http://book.cakephp.org/view/1414/checkbox
|
|
|
+ * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#options-for-select-checkbox-and-radio-inputs
|
|
|
*/
|
|
|
public function checkbox($fieldName, $options = array()) {
|
|
|
$valueOptions = array();
|
|
|
@@ -1251,7 +1251,7 @@ class FormHelper extends AppHelper {
|
|
|
* @param array $options Radio button options array.
|
|
|
* @param array $attributes Array of HTML attributes, and special attributes above.
|
|
|
* @return string Completed radio widget set.
|
|
|
- * @link http://book.cakephp.org/view/1429/radio
|
|
|
+ * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#options-for-select-checkbox-and-radio-inputs
|
|
|
*/
|
|
|
public function radio($fieldName, $options = array(), $attributes = array()) {
|
|
|
$attributes = $this->_initInputField($fieldName, $attributes);
|
|
|
@@ -1377,7 +1377,7 @@ class FormHelper extends AppHelper {
|
|
|
* @param string $fieldName Name of a field, in the form "Modelname.fieldname"
|
|
|
* @param array $options Array of HTML attributes, and special options above.
|
|
|
* @return string A generated HTML text input element
|
|
|
- * @link http://book.cakephp.org/view/1433/textarea
|
|
|
+ * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#FormHelper::textarea
|
|
|
*/
|
|
|
public function textarea($fieldName, $options = array()) {
|
|
|
$options = $this->_initInputField($fieldName, $options);
|
|
|
@@ -1399,7 +1399,7 @@ class FormHelper extends AppHelper {
|
|
|
* @param string $fieldName Name of a field, in the form of "Modelname.fieldname"
|
|
|
* @param array $options Array of HTML attributes.
|
|
|
* @return string A generated hidden input
|
|
|
- * @link http://book.cakephp.org/view/1425/hidden
|
|
|
+ * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#FormHelper::hidden
|
|
|
*/
|
|
|
public function hidden($fieldName, $options = array()) {
|
|
|
$secure = true;
|
|
|
@@ -1425,7 +1425,7 @@ class FormHelper extends AppHelper {
|
|
|
* @param string $fieldName Name of a field, in the form "Modelname.fieldname"
|
|
|
* @param array $options Array of HTML attributes.
|
|
|
* @return string A generated file input.
|
|
|
- * @link http://book.cakephp.org/view/1424/file
|
|
|
+ * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#FormHelper::file
|
|
|
*/
|
|
|
public function file($fieldName, $options = array()) {
|
|
|
$options += array('secure' => true);
|
|
|
@@ -1453,7 +1453,7 @@ class FormHelper extends AppHelper {
|
|
|
* @param string $title The button's caption. Not automatically HTML encoded
|
|
|
* @param array $options Array of options and HTML attributes.
|
|
|
* @return string A HTML button tag.
|
|
|
- * @link http://book.cakephp.org/view/1415/button
|
|
|
+ * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#FormHelper::button
|
|
|
*/
|
|
|
public function button($title, $options = array()) {
|
|
|
$options += array('type' => 'submit', 'escape' => false, 'secure' => false);
|
|
|
@@ -1578,7 +1578,7 @@ class FormHelper extends AppHelper {
|
|
|
* OR if the first character is not /, image is relative to webroot/img.
|
|
|
* @param array $options Array of options. See above.
|
|
|
* @return string A HTML submit button
|
|
|
- * @link http://book.cakephp.org/view/1431/submit
|
|
|
+ * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#FormHelper::submit
|
|
|
*/
|
|
|
public function submit($caption = null, $options = array()) {
|
|
|
if (!is_string($caption) && empty($caption)) {
|
|
|
@@ -1698,7 +1698,7 @@ class FormHelper extends AppHelper {
|
|
|
* SELECT element
|
|
|
* @param array $attributes The HTML attributes of the select element.
|
|
|
* @return string Formatted SELECT element
|
|
|
- * @link http://book.cakephp.org/view/1430/select
|
|
|
+ * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#options-for-select-checkbox-and-radio-inputs
|
|
|
*/
|
|
|
public function select($fieldName, $options = array(), $attributes = array()) {
|
|
|
$select = array();
|
|
|
@@ -1810,7 +1810,7 @@ class FormHelper extends AppHelper {
|
|
|
* @param string $fieldName Prefix name for the SELECT element
|
|
|
* @param array $attributes HTML attributes for the select element
|
|
|
* @return string A generated day select box.
|
|
|
- * @link http://book.cakephp.org/view/1419/day
|
|
|
+ * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#FormHelper::day
|
|
|
*/
|
|
|
public function day($fieldName = null, $attributes = array()) {
|
|
|
$attributes += array('empty' => true, 'value' => null);
|
|
|
@@ -1840,7 +1840,7 @@ class FormHelper extends AppHelper {
|
|
|
* @param integer $maxYear Last year in sequence
|
|
|
* @param array $attributes Attribute array for the select elements.
|
|
|
* @return string Completed year select input
|
|
|
- * @link http://book.cakephp.org/view/1416/year
|
|
|
+ * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#FormHelper::year
|
|
|
*/
|
|
|
public function year($fieldName, $minYear = null, $maxYear = null, $attributes = array()) {
|
|
|
$attributes += array('empty' => true, 'value' => null);
|
|
|
@@ -1892,7 +1892,7 @@ class FormHelper extends AppHelper {
|
|
|
* @param string $fieldName Prefix name for the SELECT element
|
|
|
* @param array $attributes Attributes for the select element
|
|
|
* @return string A generated month select dropdown.
|
|
|
- * @link http://book.cakephp.org/view/1417/month
|
|
|
+ * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#FormHelper::month
|
|
|
*/
|
|
|
public function month($fieldName, $attributes = array()) {
|
|
|
$attributes += array('empty' => true, 'value' => null);
|
|
|
@@ -1928,7 +1928,7 @@ class FormHelper extends AppHelper {
|
|
|
* @param boolean $format24Hours True for 24 hours format
|
|
|
* @param array $attributes List of HTML attributes
|
|
|
* @return string Completed hour select input
|
|
|
- * @link http://book.cakephp.org/view/1420/hour
|
|
|
+ * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#FormHelper::hour
|
|
|
*/
|
|
|
public function hour($fieldName, $format24Hours = false, $attributes = array()) {
|
|
|
$attributes += array('empty' => true, 'value' => null);
|
|
|
@@ -1962,7 +1962,7 @@ class FormHelper extends AppHelper {
|
|
|
* @param string $fieldName Prefix name for the SELECT element
|
|
|
* @param string $attributes Array of Attributes
|
|
|
* @return string Completed minute select input.
|
|
|
- * @link http://book.cakephp.org/view/1421/minute
|
|
|
+ * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#FormHelper::minute
|
|
|
*/
|
|
|
public function minute($fieldName, $attributes = array()) {
|
|
|
$attributes += array('empty' => true, 'value' => null);
|
|
|
@@ -2022,7 +2022,7 @@ class FormHelper extends AppHelper {
|
|
|
* @param string $fieldName Prefix name for the SELECT element
|
|
|
* @param string $attributes Array of Attributes
|
|
|
* @return string Completed meridian select input
|
|
|
- * @link http://book.cakephp.org/view/1422/meridian
|
|
|
+ * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#FormHelper::meridian
|
|
|
*/
|
|
|
public function meridian($fieldName, $attributes = array()) {
|
|
|
$attributes += array('empty' => true, 'value' => null);
|
|
|
@@ -2071,7 +2071,7 @@ class FormHelper extends AppHelper {
|
|
|
* @param string $timeFormat 12, 24.
|
|
|
* @param string $attributes array of Attributes
|
|
|
* @return string Generated set of select boxes for the date and time formats chosen.
|
|
|
- * @link http://book.cakephp.org/view/1418/dateTime
|
|
|
+ * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#FormHelper::dateTime
|
|
|
*/
|
|
|
public function dateTime($fieldName, $dateFormat = 'DMY', $timeFormat = '12', $attributes = array()) {
|
|
|
$attributes += array('empty' => true, 'value' => null);
|