我正在開發一個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