doupaxia2478
2016-10-06 10:07
采纳率: 100%
浏览 36
已采纳

在Symfony的配置中使用route作为url

I use CKEditor and want to use uploadimage plugin. I need to specify uploadUrl in config.yml. How can I put here a route instead of direct url?

ivory_ck_editor:
    default_config: my_config
    configs:
        my_config:
            extraPlugins: "lineutils,widget,notificationaggregator,uploadwidget,notification,uploadimage,wordcount"
            uploadUrl: '/admin/upload'

I know I can redefine config with form builder

$builder->add('field', 'ckeditor', array(
    'config' => array('uploadUrl' => ...),
));

But I want to do it once for every form. Which is the best way?

图片转代码服务由CSDN问答提供 功能建议

我使用CKEditor并想使用 uploadimage 插件。 我需要在config.yml中指定 uploadUrl 。 如何在这里放置路由而不是直接url?

  ivory_ck_editor:
 default_config:my_config 
 configs:
 my_config:
 extraPlugins:“lineutils,widget,  notificationaggregator,uploadwidget,notification,uploadimage,wordcount“
 uploadUrl:'/ admin / upload'
   
 
 

我知道我可以使用表单构建器重新定义配置

  $ builder-> add('field','ckeditor',array(
'config'=> array('uploadUrl'=> ...),
  )); 
   
 
 

但我想为每个表单做一次。 哪种方法最好?

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

相关推荐 更多相似问题