From 48e7bd2616aa8d16cac55269cdc18c11f868928b Mon Sep 17 00:00:00 2001 From: gnat42 Date: Thu, 3 Jul 2014 13:34:07 -0600 Subject: [PATCH] If a description is not provided use form label It would be nice if there was no description the form label was used instead. In the future I think it would be even better to have the label as an header, and the description as 'additional' instructions. --- Parser/FormTypeParser.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Parser/FormTypeParser.php b/Parser/FormTypeParser.php index d67d3f9..300ab6e 100644 --- a/Parser/FormTypeParser.php +++ b/Parser/FormTypeParser.php @@ -187,7 +187,7 @@ class FormTypeParser implements ParserInterface 'default' => null, 'subType' => $subType, 'required' => $config->getRequired(), - 'description' => $config->getAttribute('description'), + 'description' => ($config->getOption('description')) ? $config->getOption('description'):$config->getOption('label'), 'readonly' => $config->getDisabled(), 'children' => $children, ); @@ -205,7 +205,7 @@ class FormTypeParser implements ParserInterface 'actualType' => 'string', 'default' => $config->getData(), 'required' => $config->getRequired(), - 'description' => $config->getAttribute('description'), + 'description' => ($config->getOption('description')) ? $config->getOption('description'):$config->getOption('label'), 'readonly' => $config->getDisabled(), ); } @@ -221,7 +221,7 @@ class FormTypeParser implements ParserInterface 'subType' => $subType, 'default' => $config->getData(), 'required' => $config->getRequired(), - 'description' => $config->getAttribute('description'), + 'description' => ($config->getOption('description')) ? $config->getOption('description'):$config->getOption('label'), 'readonly' => $config->getDisabled(), );