Exemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function buildView(FormView $view, FormInterface $form, array $options)
 {
     $view->vars['id'] = uniqid(self::$uniqueIdPrefix++);
     $option = new WysiwygOption();
     $option->setFormats($options['formats']);
     $option->setToolbar1($options['toolbar1']);
     $option->setToolbar2($options['toolbar2']);
     $option->setHeight($options['height']);
     $option->setContentCss($options['content_css']);
     $view->vars['config'] = $this->config->getData($option);
 }
Exemplo n.º 2
0
 public function testGetData()
 {
     $config = new WysiwygConfig();
     $option = new WysiwygOption();
     $data = $config->getData($option);
     $this->assertJson($data);
     $data = json_decode($data, true);
     $this->assertArrayHasKey('formats', $data);
     $this->assertArrayHasKey('toolbar1', $data);
     $this->assertArrayHasKey('toolbar2', $data);
     $this->assertArrayHasKey('height', $data);
     $this->assertArrayHasKey('style_formats', $data);
     $this->assertArrayHasKey('content_css', $data);
 }