2011-07-14 17 views
2

我使用symfony 1.4.11。我旁边:如何验证sfWidgetFormTextareaTinyMCE

$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',) 
    ); 

我需要validte这一点,我尝试sfValidatorString,但实在不行

回答

2

你没有设置你的widget(一个可能没有你的验证)正确。如果你想分组/嵌套小部件,你需要在你的容器表单中嵌入另一个表单。

编辑:

要么你创造出具有“内容”窗口小部件,您可以在父窗体中嵌入像这样的新形式:

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

或者添加小部件,像这样:

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

的细节真的取决于你的用例,而我可能会建议你在这里的形式读了:

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

+0

你能解释一下吗? – denys281

+0

大谢谢!!! – denys281