开发者

Symfony 1.4 backend: coexistence of generator.yml and form class for custom partial

I am building a backend admin for writing articles on an online newspaper and I need to insert images (1-to-n Relation). Actually I wrote a form which handles the fields to display and this works well.

Now I want to add a partial which will display the images already linked to the articles, so I have a component class with an action executeShowImages as well as a template _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:         开发者_如何学Go  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:     ~

If I do it this way, only the showImage component is displayed. How can do that?

Thanks a lot for your help


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).

So your form option should be something like this:

  form:
    class: ArticleFormBackend
    display: [ title, body, ~showImages ]
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜