예제 #1
0
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $builder->setAttribute('enable', $options['enable']);
     if ($builder->getAttribute('enable')) {
         $builder->setAttribute('base_path', $options['base_path']);
         $builder->setAttribute('js_path', $options['js_path']);
         $config = $options['config'];
         if ($options['config_name'] === null) {
             $name = uniqid('ivory', true);
             $options['config_name'] = $name;
             $this->configManager->setConfig($name, $config);
         } else {
             $this->configManager->mergeConfig($options['config_name'], $config);
         }
         $this->pluginManager->setPlugins($options['plugins']);
         $this->stylesSetManager->setStylesSets($options['styles']);
         $this->templateManager->setTemplates($options['templates']);
         $builder->setAttribute('config', $this->configManager->getConfig($options['config_name']));
         $builder->setAttribute('plugins', $this->pluginManager->getPlugins());
         $builder->setAttribute('styles', $this->stylesSetManager->getStylesSets());
         $builder->setAttribute('templates', $this->templateManager->getTemplates());
     }
 }
예제 #2
0
 /**
  * @expectedException \Ivory\CKEditorBundle\Exception\TemplateManagerException
  * @expectedExceptionMessage The CKEditor template "foo" does not exist.
  */
 public function testGetTemplateWithInvalidValue()
 {
     $this->templateManager->getTemplate('foo');
 }