我正在开发一个PHP-web应用程序,使用TinymceBundle将文本框设置为WYSIWYG-Editors(我接管了该项目,但没有实现这个功能功能)。Symfony2 TinymceBundle - 更新后不保存CTRL-S
显然,标准的tinyMCE Editor具有内置功能,可捕获CTRL
+ S
Click事件并将其视为表单提交(而不是浏览器尝试保存当前网站)。
但现在我做了供应商库的更新,包括TinymceBundle和CTRL
+ S
保存表单不再工作。
这是小工具的配置app/config.yml
我如何找到它:
stfalcon_tinymce:
include_jquery: true
textarea_class: "tinymce"
theme:
simple:
mode: "textareas"
theme: "advanced"
width: '728' #firefox on windows made it too wide for some reason
theme_advanced_buttons1: "mylistbox,mysplitbutton,bold,italic,underline,separator,strikethrough,justifyleft,justifycenter,justifyright,justifyfull,bullist,numlist,undo,redo,link,unlink"
theme_advanced_buttons2: ""
theme_advanced_buttons3: ""
theme_advanced_toolbar_location: "top"
theme_advanced_toolbar_align: "left"
theme_advanced_statusbar_location: "bottom"
plugins: "fullscreen"
theme_advanced_buttons1_add: "fullscreen"
advanced:
language: de
theme: "advanced"
plugins: "pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,noneditable,visualchars,nonbreaking,xhtmlxtras,template"
theme_advanced_buttons1: "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,formatselect,fontselect,fontsizeselect"
theme_advanced_buttons2: "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,cleanup,code,|,insertdate,inserttime,preview,|,forecolor,backcolor"
theme_advanced_buttons3: "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,|,ltr,rtl,|,fullscreen"
theme_advanced_buttons4: "moveforward,movebackward,|,scite,del,ins,|,visualchars,nonbreaking,pagebreak"
theme_advanced_toolbar_location: "top"
theme_advanced_toolbar_align: "left"
theme_advanced_statusbar_location: "bottom"
theme_advanced_resizing: true
为我所看到的,没有什么特别使CTRL + S保存功能,所以我认为它是启用默认情况下,但现在我需要一些东西来重新启用它(因为客户在更新后缺少它),并且我在tinyMCE documentation找不到配置选项。
保持旧版本不是一个真正的选择。
有谁知道如何启用CTRL
+ S
=形式由专人或提交功能TinymceBundle的更新后也同样遇到此行为(如果它是TinyMCE的我不能做我猜一个bug)?
在此先感谢!
编辑:日以下是在应用程序中用来渲染编辑器的代码 - 遗憾的是几乎所有的JS-初始化封装在TinymceBundle
,连tinyMCE.init(...)
呼叫 - 将整个配置应该在工作条目在app/config.ym
。
具有文本字段的NoticeType
类:
{% extends 'EvenosEnoticeBundle::base.html.twig' %}
{% block body %}
<h1>Neue Notiz</h1>
{{ tinymce_init() }}
<form action="{{ path('notice_create') }}" method="post" {{ form_enctype(form) }}>
[...other fields...]
{{ form_label(form.text, 'Text') }}
{{ form_widget(form.text, { 'attr': {'cols': '100', 'rows': 20} }) }}
[...]
<p>
<button type="submit" class="btnCreate">Anlegen</button>
</p>
</form>
[...]
{% endblock %}
更新问:是否有人知道我怎么可以配置TinyMCE的
class NoticeType extends AbstractType
{
public function buildForm(FormBuilder $builder, array $options)
{
$builder
->add('contact')
->add('user')
->add('direction', 'choice', array(
'choices' => array('out' => 'Ausgehend', 'in' => 'Eingehend',),
'required' => true,
))
->add('text', 'textarea', array(
'attr' => array('class' => 'tinymce'),
))
->add('customer')
->add('date', 'datetime', array(
'input' => 'datetime',
// 'date_format' => \IntlDateFormatter::FULL,
'widget' => 'single_text',
))
;
}
public function getName()
{
return 'evenos_enoticebundle_noticetype';
}
}
在形式呈现模板
具体使用Stfalcon/TinymceBundle
为Symfony2
?。正如我所掌握的,它意味着只能通过symfony .yml
文件进行配置,这些文件不会让您添加例如功能像TinyMCE的
我在这里面临同样的问题!!你可以在symfony2找到这个soln! – 2015-03-20 08:42:49