如何验证 sfWidgetFormTextareaTinyMCE

发布于 2024-11-24 19:12:51 字数 931 浏览 2 评论 0原文

我使用 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 ,但它不起作用

I use symfony 1.4.11. And I have next:

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

I need to validte this, I try sfValidatorString ,but it is not work

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

淡淡绿茶香 2024-12-01 19:12:52

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

编辑:

要么创建一个具有“内容”小部件的新表单,将其嵌入到父表单中,如下所示:

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

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

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

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

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

You are not setting your widget (an probably neither your validator) correctly. If you want to group/nest widgets you need to embed another form in your container form.

EDIT:

Either you create a new form which has the 'content' widget, which you embed in the parent form like so:

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

Alternatively you add the widget like so:

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

The specifics really depend on your usecase, and I might suggest you read up on forms here:

http://www.symfony-project.org/forms/1_2/en/ (still relevant for 1.4)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文