Gentics Portal.Node PHP API
 All Classes Namespaces Functions Variables Pages
NotContainsTagsValidator.php
1 <?php
2 /**
3  *
4  */
5 class NotContainsTagsValidator extends CValidator
6 {
7 
8  /**
9  * Validates a single attribute.
10  * This method should be overridden by child classes.
11  * @param CModel $object the data object being validated
12  * @param string $attribute the name of the attribute to be validated.
13  */
14  protected function validateAttribute($object, $attribute)
15  {
16  if ($object->$attribute != strip_tags($object->$attribute)) {
17  $this->addError($object, $attribute, UserModule::t("Field shouldn't contains any tags"));
18  }
19  }
20 }