title: Image. textfield and textarea in buildForm for every domain language in Symfony 4
body: <p>Okay, another issue. It's a bit hard to explain so sorry in advance.</p>
  
  <p>I have an entity called <code>SlideContent</code>, which basically stores the <code>id</code>, the <code>slide</code> (relation to an entity called <code>SlideshowSlide</code>), <code>language</code> (relation to an entity called <code>Language</code>), <code>title</code> and <code>content</code>.</p>
  
  <p>I also have an entity called <code>Domain</code>. This has an relation to <code>Language</code> as well (as every <code>Domain</code> has one language).</p>
  
  <p>Every <code>User</code> can have one or more <code>Domain</code>s they have rights on. If you have rights on a <code>Domain</code>, you obviously have auto rights for the <code>Language</code> of that <code>Domain</code>.</p>
  
  <p>Now, what I need to do is, add a <code>tr</code> in a <code>table</code> for every <code>Language</code> the <code>User</code> has rights on. In that <code>tr</code>, it needs to display the <code>base64img</code> from <code>Language</code> as an image, an input field for the title and a textarea for the content. I prefer to have it in a form class.</p>
  
  <p>I tried the following:</p>
  
  <pre><code>public function buildForm(FormBuilderInterface $builder, array $options)
  {
      foreach ($options['user']-&gt;getDomains() as $domain)
      {
          $builder-&gt;add('titles[' . $domain-&gt;getLanguage()-&gt;getId() . ']', TextType::class);
      }
  }
  
  public function configureOptions(OptionsResolver $resolver)
  {
      $resolver-&gt;setDefaults(array(
          'user' =&gt; null
      ));
  }
  </code></pre>
  
  <p>But I get the following error:</p>
  
  <p><code>The name "titles[2]" contains illegal characters. Names should start with a letter, digit or underscore and only contain letters, digits, numbers, underscores ("_"), hyphens ("-") and colons (":").</code></p>
  
  <p>Is it possible to do what I want? I know I probably have to do one more foreach in my template for the <code>base64img</code> and for adding everything in a <code>tr</code>, but how can I achieve what I want in terms of the indexed array input fields?</p>