如何验证sfWidgetFormTextareaTinyMCE

时间:2011-07-14 20:40:10

标签: validation symfony1 tinymce symfony-1.4 symfony-forms

我使用symfony 1.4.11。我接下来了:

$this->widgetSchema['en']['content'] = new sfWidgetFormTextareaTinyMCE(array(
        'width'   => 900,
        'height'  => 300,
          'config' => 'theme_advanced_buttons1 : "cut, copy, paste, images, bold, italic, underline, justifyleft, justifycenter, justifyright , outdent, indent, bullist, numlist, undo, redo, link",
                       theme_advanced_buttons2 : "",            
                       theme_advanced_buttons3 : "",
                       theme_advanced_toolbar_location : "top",
                       theme_advanced_toolbar_align : "left",
                       theme_advanced_statusbar_location : "bottom",
                       theme_advanced_resizing: "false",
                       plugins: "images, paste",
                       '),array('class' => 'tinyMCE',)
    );  

我需要验证这一点,我尝试sfValidatorString,但它不起作用

1 个答案:

答案 0 :(得分:2)

您没有正确设置窗口小部件(可能既不是您的验证器)。如果要分组/嵌套窗口小部件,则需要在容器窗体中嵌入另一个窗体。

编辑:

您要么创建一个包含“内容”小部件的新表单,您可以将其嵌入父表单中,如下所示:

$this->embedForm('en', new myContentForm());

或者你可以这样添加小部件:

$this->widgetSchema['content_en'] = new sfWidgetFormTextareaTinyMCE(...);

具体细节实际上取决于您的用例,我建议您在此处阅读表格:

http://www.symfony-project.org/forms/1_2/en/(仍与1.4相关)