English 中文(简体)
Symfony 1.4后端:generator.yml和自定义分部的form类共存
原标题:Symfony 1.4 backend: coexistence of generator.yml and form class for custom partial

我正在建立一个在网上报纸上写文章的后端管理员,我需要插入图片(1对n关系)。事实上,我写了一个表单来处理要显示的字段,这很好。

现在我想添加一个分部,它将显示已经链接到文章的图像,所以我有一个组件类,其中包含一个操作executeShowImages和一个模板_showImages.php。

My question I would to keep all the definition in the form class, but just add this component/partial display and I cannot do it easily. Here is my generator file:

    generator:
  class: sfPropelGenerator
  param:
    model_class:           article
    theme:                 admin
    non_verbose_templates: true
    with_show:             false
    singular:              article
    plural:                articles
    route_prefix:          article
    with_propel_route:     1
    actions_base_class:    sfActions

    config:
      actions: ~
      fields:  ~
      list:    ~
      filter:  ~
      form:
        class: ArticleFormBackend
        display: [ ~showImages ]
      edit:    ~
      new:     ~

如果以这种方式执行,则只显示showImage组件。怎么能做到?

非常感谢你的帮助

最佳回答

Yes you are right - only showImage component is displayed . You should to insert list of all fields you want to see (if you override option).

所以你的表单选项应该是这样的:

  form:
    class: ArticleFormBackend
    display: [ title, body, ~showImages ]
问题回答

暂无回答




相关问题
Connecting Actionscript 3.0 with a C++ backend?

I am curious to know if there is a way of connecting a flash front-end to a C++ driven backend? I m not currently working on a project that involves this, but I found out about an application used in ...

Django - update a model won t delete the old FileField

I am implementing an application with django, which has a model with a FileField: class Slideshow(models.Model): name = models.CharField(max_length=30,unique=True) thumbnail = models....

MS Access 2003 - Really simple query

If I try to duplicate an access file (this file is split into mdb and be mdb, and also has mde files), by importing everything into a brand new access application, why won t the table links work? ...

Building a website backend in c#, compiled to a binary

I am creating a novel website that integrates web feeds from around the internet. I want to build a backend that does CPU intensive analysis of the web data on a regular basis, which will eventually ...

Need a cool hotkey for my hidden website-login

I am developing a CMS. One of the greatest everyday annoyances when working with it is that when you are on a front-end page, not logged in, and want to make a change, you need to go to the back-end ...

热门标签