问题
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