开发者

is it possible in symfony 1.4 to pass options to the embedded i18n forms?

I have a Template model which is i18n and has a TemplateForm and a TemplateTranslationForm. I embed the translation form with:

$this->embedI18n(开发者_高级运维array($this->getOption('edit_lang')));

My problem is that if the field is_html is checked in the main TemplateForm, than the embedded form validator should be aware of that and will not strip down html tags from the body of the Template. But I cannot pass options from the main form to the i18n one, thus I don't know how to implement it. Any idea?

This is my schema:

Template:
  actAs:
    Timestampable: ~
    I18n:
      fields: [body, subject]
  connection: master
  tableName: template
  columns:
    is_html: boolean
    subject: string(150)
    body: clob
    label: string(30)
MailTemplate:
  inheritance:
    extends: Template
    type: column_aggregation
    keyField: type
    keyValue: 1
PageTemplate:
  inheritance:
    extends: Template
    type: column_aggregation
    keyField: type
    keyValue: 2
DocumentTemplate:
  inheritance:
    extends: Template
    type: column_aggregation
    keyField: type
    keyValue: 3


embedI18n is just a wrapper around embedForm. If you need to pass additional options to the embedded form, use embedForm() instead.

Have a look at sfFormDoctrine::embedI18n() to understand what it exactly does.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜