[TASK] Update examples in ValidationResults ViewHelper
authorWouter Wolters <typo3@wouterwolters.nl>
Wed, 6 Mar 2013 10:34:50 +0000 (11:34 +0100)
committerMarc Bastian Heinrichs <typo3@mbh-software.de>
Wed, 6 Mar 2013 18:59:50 +0000 (19:59 +0100)
The examples in the docblock comment in
\TYPO3\CMS\Fluid\ViewHelpers\Form\ValidationResultsViewHelper
need to be updated to match this ViewHelper.

Change-Id: I133faa0ed76f52bd7c534da241da016dfb0be1f5
Resolves: #40813
Releases: 6.1, 6.0, 4.7
Reviewed-on: https://review.typo3.org/18581
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Marc Bastian Heinrichs
Tested-by: Marc Bastian Heinrichs
typo3/sysext/fluid/Classes/ViewHelpers/Form/ValidationResultsViewHelper.php

index 6d94687..8eb57b5 100644 (file)
@@ -20,35 +20,50 @@ namespace TYPO3\CMS\Fluid\ViewHelpers\Form;
  *                                                                        *
  * The TYPO3 project - inspiring people to share!                         *
  *                                                                        */
  *                                                                        *
  * The TYPO3 project - inspiring people to share!                         *
  *                                                                        */
+
 /**
 /**
- * Error messages view helper
+ * Validation results view helper
  *
  * = Examples =
  *
  * <code title="Output error messages as a list">
  *
  * = Examples =
  *
  * <code title="Output error messages as a list">
- * <ul class="errors">
- * <f:form.errors>
- * <li>{error.code}: {error.message}</li>
- * </f:form.errors>
- * </ul>
+ * <f:form.validationResults>
+ *   <f:if condition="{validationResults.flattenedErrors}">
+ *     <ul class="errors">
+ *       <f:for each="{validationResults.flattenedErrors}" as="errors" key="propertyPath">
+ *         <li>{propertyPath}
+ *           <ul>
+ *           <f:for each="{errors}" as="error">
+ *             <li>{error.code}: {error}</li>
+ *           </f:for>
+ *           </ul>
+ *         </li>
+ *       </f:for>
+ *     </ul>
+ *   </f:if>
+ * </f:form.validationResults>
  * </code>
  * <output>
  * </code>
  * <output>
- * <ul>
- * <li>1234567890: Validation errors for argument "newBlog"</li>
+ * <ul class="errors">
+ *   <li>1234567890: Validation errors for argument "newBlog"</li>
  * </ul>
  * </output>
  *
  * <code title="Output error messages for a single property">
  * </ul>
  * </output>
  *
  * <code title="Output error messages for a single property">
- * <f:form.errors for="someProperty">
- * <div class="error">
- * <strong>{error.propertyName}</strong>: <f:for each="{error.errors}" as="errorDetail">{errorDetail.message}</f:for>
- * </div>
- * </f:form.errors>
+ * <f:form.validationResults for="someProperty">
+ *   <f:if condition="{validationResults.flattenedErrors}">
+ *     <ul class="errors">
+ *       <f:for each="{validationResults.errors}" as="error">
+ *         <li>{error.code}: {error}</li>
+ *       </f:for>
+ *     </ul>
+ *   </f:if>
+ * </f:form.validationResults>
  * </code>
  * <output>
  * </code>
  * <output>
- * <div class="error>
- * <strong>someProperty:</strong> errorMessage1 errorMessage2
- * </div>
+ * <ul class="errors">
+ *   <li>1234567890: Some error message</li>
+ * </ul>
  * </output>
  *
  * @api
  * </output>
  *
  * @api