Add a class name to certain rows of an admin-generated module
I have a symfony project where I have 开发者_如何学运维a module called ImportBundle. For rows where $import_bundle->getIsForTesting()
, I want the row to show up red. If I remember correctly, there's an easy way to add a class name to each row that meets a certain criteria, but I can't remember how its done. Can anyone help me remember what it is?
I supose you are using a tabular layout for your index so the simplest way to do this is to modify the _list_td_tabular.php partial in your module template folder. This partial takes care of a row representation so you could add a class if a condition is reached.
Hope this helps
精彩评论