Symfony 1.4: how to NOT display any filter through generator.yml

自古美人都是妖i 提交于 2020-01-14 03:29:29

问题


I created an admin module in Symfony. I would like to show the table list but without filters.

By default I get all filters. I managed to unset all the filters by hand -using unset, in the filterForm file of the module. Even more, I enabled just one filter and unset it. Used the unset($this->widgetSchema['filter'], ...) for that. I don't like this solution.

I would like to do it using the generator.yml:

I tried:

  I)   filter: false

  II)  filter:
         display: false 

  III) filter:
        display: [] <-- empty!

None worked. I read that using credentials could be possible but I would like to do it in a more simple a concrete way.

Thank you.

EDIT: My actual generator. Is the default really:

generator:
class: sfPropelGenerator
param:
  model_class:           halt
  theme:                 admin15
  non_verbose_templates: true
  with_show:             false
  singular:              Halt
  plural:                Halts
  route_prefix:          halt
  with_propel_route:     1
  actions_base_class:    sfActions

config:
  actions: ~
  fields:  ~
  list:
    object_actions: {}
    batch_actions: {}
  filter:  ~
  form:    ~
  edit:    ~
  new:     ~

回答1:


You are almost done but you don't test everything :)

filter:
  class: false

http://www.symfony-project.org/reference/1_4/en/06-Admin-Generator#chapter_06_filter

To completely remove the filtering feature, set the class to false.



来源:https://stackoverflow.com/questions/10352922/symfony-1-4-how-to-not-display-any-filter-through-generator-yml

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!