Moving tagIsInvalid from Helper back to FormHelper, as it is a better home for it

This commit is contained in:
Jose Lorenzo Rodriguez 2011-07-13 23:49:01 -04:30
parent 567ac0209c
commit 22f02373c9
2 changed files with 16 additions and 25 deletions
lib/Cake/View

View file

@ -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.