add new demo symfony files
This commit is contained in:
26
app/templates/form/fields.html.twig
Normal file
26
app/templates/form/fields.html.twig
Normal file
@@ -0,0 +1,26 @@
|
||||
{#
|
||||
Each field type is rendered by a template fragment, which is determined
|
||||
by the name of your form type class (DateTimePickerType -> date_time_picker)
|
||||
and the suffix "_widget". This can be controlled by overriding getBlockPrefix()
|
||||
in DateTimePickerType.
|
||||
|
||||
See https://symfony.com/doc/current/form/create_custom_field_type.html#creating-the-form-type-template
|
||||
#}
|
||||
|
||||
{% block date_time_picker_widget %}
|
||||
<div class="input-group date" data-toggle="datetimepicker">
|
||||
{{ block('datetime_widget') }}
|
||||
<span class="input-group-addon">
|
||||
<span class="fa fa-calendar" aria-hidden="true"></span>
|
||||
</span>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block tags_input_widget %}
|
||||
<div class="input-group">
|
||||
{{ form_widget(form, {'attr': {'data-toggle': 'tagsinput', 'data-tags': tags|json_encode}}) }}
|
||||
<span class="input-group-addon">
|
||||
<span class="fa fa-tags" aria-hidden="true"></span>
|
||||
</span>
|
||||
</div>
|
||||
{% endblock %}
|
16
app/templates/form/layout.html.twig
Normal file
16
app/templates/form/layout.html.twig
Normal file
@@ -0,0 +1,16 @@
|
||||
{% extends 'bootstrap_3_layout.html.twig' %}
|
||||
|
||||
{# Errors #}
|
||||
|
||||
{% block form_errors -%}
|
||||
{% if errors|length > 0 -%}
|
||||
{% if form is not rootform %}<span class="help-block">{% else %}<div class="alert alert-danger">{% endif %}
|
||||
<ul class="list-unstyled">
|
||||
{%- for error in errors -%}
|
||||
{# use font-awesome icon library #}
|
||||
<li><span class="fa fa-exclamation-triangle"></span> {{ error.message }}</li>
|
||||
{%- endfor -%}
|
||||
</ul>
|
||||
{% if form is not rootform %}</span>{% else %}</div>{% endif %}
|
||||
{%- endif %}
|
||||
{%- endblock form_errors %}
|
Reference in New Issue
Block a user