[Symfony 2.1] Bundle StFalconTinymce : Toolbar
Bonjour,
Je travaille sur un projet Symfony auquel j'ai intégré le bundle StFalconTinymce (wysiwyg).
J'ai bien suivi la procédure pour la mise en place du bundle : https://github.com/stfalcon/TinymceBundle
Mon problème est qu'à l'affichage, j'ai effectivement une textearea mais je n'ai pas la toolbar.
View (twig.html)
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| {% extends '::base.html.twig' %}
{% block body_title %}
Ajout Contact
{% endblock body_title %}
{% block javascripts %}
{{ parent() }}
{{ tinymce_init() }}
{% endblock %}
{% block body_inner %}
<form action="{{ path('add_contact' }}" method="post" {{ form_enctype(edit_form) }}>
{{ form_widget(edit_form) }}
<br>
<p>
<button class="btn" type="button" onclick="self.location.href='{{ path('contact') }}'" >Retour à la liste</button>
</p>
</form>
{% endblock body_inner %} |
Mon formulaire (.php)
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
| <?php
namespace YTGBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\EntityManager;
use YTGBundle\Entity\Contact;
class ContactForm extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$data = $options["data"];
$builder
->add('lastName', 'text', array('label' => 'Nom '))
->add('fisrtName', 'text', array('label' => 'Prénom '))
->add('email', 'text', array('label' => 'Email ',))
->add('test', 'textarea', array(
'label'=>'Test: ',
'attr' => array (
'class'=> 'tinymce',
'data-theme' => 'medium')))
;
}
public function getName()
{
return 'ytg_contactForm';
}
public function getDefaultOptions(array $options)
{
return array(
'data_class' => 'YTGBundle\Entity\Contact',
);
}
} |
Je vous remercie pour votre aide.
A bientôt !