I'm very new to Symfony 2. I'm trying to add some other custom form fields.
The bundle I'm using has been made this way:
src/TheClient/
`-- Bundle
|-- MyBundle
| |-- Controller
| |-- DependencyInjection
| |-- Entity
| |-- Form
| |-- Repository
| |-- Resources
| `-- Tests
`-- OtherNotImportantBundle
|-- Command
|-- Controller
|-- DependencyInjection
|-- Entity
|-- Resources
|-- Services
`-- Tests
I've created the file src/TheClient/Bundle/MyBundle/Resources/views/Form/fields.html.twig where there is some code like this:
{% block form_row %}
<div class="control-group">
{{ form_label(form) }}
{{ form_errors(form) }}
{{ form_widget(form) }}
</div>
{% endblock %}
{% block text_widget %}
<div class="text_widget controls">
{% set type = type|default('text') %}
{{ block('form_widget_simple') }}
</div>
{% endblock %}
To make it short, it overrides the original form ressource to enclose it with div's.
Now, what I'm supposed to do is just edit app/config/config.yml and precise the new form fields like this:
# Twig Configuration
twig:
debug: %kernel.debug%
strict_variables: %kernel.debug%
globals:
sso_host: %sso_host%
root_url: %root_url%
form:
resources:
- 'TheClientMyBundle:Form:fields.html.twig'
# - 'MyBundle:Form:fields.html.twig'
I've tried both solutions and they dont work, I get an error 500. I'm very new to Symfony 2. What are the steps, where should I look, to make it work?
I forgot to precise: I'm trying to follow this tutoriel from the Symfony website itself.
Thank you very much
src/Client/Bundle/MyBundle, you should have something looking likesrc/Client/MyBundle