Skip to content

Commit

Permalink
add default value in template
Browse files Browse the repository at this point in the history
add comment to explain nullable
  • Loading branch information
baptiste committed Feb 22, 2017
1 parent 9f8baa8 commit d1acc6a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions Entity/WidgetForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ class WidgetForm extends Widget
/**
* @var string
*
* Nullable for not break with old install but it's required in form and default value is set in template
* @ORM\Column(name="submit_class", type="string", length=255, nullable=true)
* @Assert\NotBlank()
*/
Expand Down
2 changes: 1 addition & 1 deletion Resources/views/show.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
{% endfor %}
</div>

<button type="submit" class="btn btn-{{ submitClass }} pull-right">
<button type="submit" class="btn btn-{{ submitClass|default('primary') }} pull-right">
{% if submitIcon %}
<span class="fa {{ submitIcon }}"></span>&nbsp;
{% endif %}
Expand Down

0 comments on commit d1acc6a

Please sign in to comment.