
<?php
class ThreadType extends AbstractType
{
/**
* @param FormBuilderInterface $builder
* @param array $options
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('title', TextareaType::class, [
'attr' => [
'class' => 'froala-form-title'
]
])
->add('messages', CollectionType::class, [
'label' => false,
'entry_type' => MessageType::class,
'entry_options' => [
'label' => false
],
]);
}
// ...
My form for create a new Thread is OK, I have my thread title field and the message field:
After that, I add multiple messages inside my thread, and when I want edit my Thread I have this problem:
My CollectionType field display one textarea by messages inside my thread, I only want edit the first message, how can I perform that on Symfony?
Source: Symfony Questions
Was this helpful?
0 / 0