mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-06-17 04:03:41 +00:00
Moving tagIsInvalid from Helper back to FormHelper, as it is a better home for it
This commit is contained in:
parent
567ac0209c
commit
22f02373c9
2 changed files with 16 additions and 25 deletions
lib/Cake/View
|
@ -64,14 +64,6 @@ class Helper extends Object {
|
|||
*/
|
||||
public $plugin = null;
|
||||
|
||||
/**
|
||||
* Contains model validation errors of form post-backs
|
||||
*
|
||||
* @access public
|
||||
* @var array
|
||||
*/
|
||||
public $validationErrors = null;
|
||||
|
||||
/**
|
||||
* Holds tag templates.
|
||||
*
|
||||
|
@ -508,23 +500,6 @@ class Helper extends Object {
|
|||
return $last;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns false if given FORM field has no errors. Otherwise it returns the constant set in
|
||||
* the array Model->validationErrors.
|
||||
*
|
||||
* @param string $model Model name as a string
|
||||
* @param string $field Fieldname as a string
|
||||
* @param integer $modelID Unique index identifying this record within the form
|
||||
* @return boolean True on errors.
|
||||
*/
|
||||
public function tagIsInvalid($model = null, $field = null, $modelID = null) {
|
||||
$errors = $this->validationErrors;
|
||||
$entity = $this->entity();
|
||||
if (!empty($entity)) {
|
||||
return Set::extract($errors, join('.', $entity));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates a DOM ID for the selected element, if one is not set.
|
||||
* Uses the current View::entity() settings to generate a CamelCased id attribute.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue