浏览代码

updated Resources/doc/reference/conditional_validation.rst

Sebastiaan Stok 12 年之前
父节点
当前提交
72a0cea6c6
共有 1 个文件被更改,包括 8 次插入3 次删除
  1. 8 3
      Resources/doc/reference/conditional_validation.rst

+ 8 - 3
Resources/doc/reference/conditional_validation.rst

@@ -3,12 +3,12 @@ Inline Validation
 
 
 The inline validation is about delegating model validation to a dedicated service.
 The inline validation is about delegating model validation to a dedicated service.
 The current validation implementation built in the Symfony2 framework is very powerful
 The current validation implementation built in the Symfony2 framework is very powerful
-as it allows to declare validation on : class, field and getter. However these declarations
-can take a while to code for complex rules. Rules must be a set of a ``Constraint``
+as it allows to declare validation on a : class, field and getter. However these declarations
+can take a while to code for complex rules. As rules must be a set of a ``Constraint``
 and ``Validator`` instances.
 and ``Validator`` instances.
 
 
 The inline validation tries to provide a nice solution by introducing an ``ErrorElement``
 The inline validation tries to provide a nice solution by introducing an ``ErrorElement``
-object. The object can be used to check assertion against the model :
+object. The object can be used to check assertions against the model :
 
 
 .. code-block:: php
 .. code-block:: php
 
 
@@ -43,6 +43,11 @@ object. The object can be used to check assertion against the model :
     This solution relies on the validator component so validation defined through
     This solution relies on the validator component so validation defined through
     the validator component will be used.
     the validator component will be used.
 
 
+.. tip::
+
+    You can also use ``$errorElement->addConstraint(new \Symfony\Component\Validator\Constraints\NotBlank())``
+    instead of calling assertNotBlank().
+
 Using this validator
 Using this validator
 --------------------
 --------------------