企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
# Class Phalcon\\Validation # Class **Phalcon\\Validation** *extends* abstract class `Phalcon\Di\Injectable` *implements*[*Phalcon\\Events\\EventsAwareInterface*](#), `Phalcon\Di\InjectionAwareInterface` Allows to validate data using custom or built-in validators ### Methods public **setValidators** (*unknown* $validators) ... public **\_\_construct** (\[*unknown* $validators\]) Phalcon\\Validation constructor public [*Phalcon\\Validation\\Message\\Group*](#)**validate** (\[*array|object* $data\], \[*object* $entity\]) Validate a set of data according to a set of rules public **add** (*unknown* $field, *unknown* $validator) Adds a validator to a field public **rule** (*unknown* $field, *unknown* $validator) Alias of add method public **rules** (*unknown* $field, *unknown* $validators) Adds the validators to a field public <a class="calibre6 pcalibre1" href="">*Phalcon\\Validation*</a>**setFilters** (*string* $field, *array|string* $filters) Adds filters to the field public *mixed***getFilters** (\[*string* $field\]) Returns all the filters or a specific one public **getValidators** () Returns the validators added to the validation public *object***getEntity** () Returns the bound entity public **setDefaultMessages** (\[*unknown* $messages\]) Adds default messages to validators public **getDefaultMessage** (*string* $type) Get default message for validator type public **getMessages** () Returns the registered validators public **setLabels** (*unknown* $labels) Adds labels for fields public *string***getLabel** (*string* $field) Get label for field public **appendMessage** (*unknown* $message) Appends a message to the messages list public <a class="calibre6 pcalibre1" href="">*Phalcon\\Validation*</a>**bind** (*object* $entity, *array|object* $data) Assigns the data to an entity The entity is used to obtain the validation values public *mixed***getValue** (*string* $field) Gets the a value to validate in the array/object data source public **setDI** (*unknown* $dependencyInjector) inherited from Phalcon\\Di\\Injectable Sets the dependency injector public **getDI** () inherited from Phalcon\\Di\\Injectable Returns the internal dependency injector public **setEventsManager** (*unknown* $eventsManager) inherited from Phalcon\\Di\\Injectable Sets the event manager public **getEventsManager** () inherited from Phalcon\\Di\\Injectable Returns the internal event manager public **\_\_get** (*unknown* $propertyName) inherited from Phalcon\\Di\\Injectable Magic method \_\_get | - [索引](# "总目录") - [下一页](# "Class Phalcon\Validation\Exception") | - [上一页](# "Class Phalcon\Translate\Exception") | - [API Indice](#) »