Browse Source

Added more info about usage of `code` option

idchlife 9 years ago
parent
commit
7a55063235
1 changed files with 4 additions and 1 deletions
  1. 4 1
      Resources/doc/reference/action_list.rst

+ 4 - 1
Resources/doc/reference/action_list.rst

@@ -104,7 +104,10 @@ Options
 - ``template`` (o): the template used to render the field
 - ``label`` (o): the name used for the column's title
 - ``link_parameters`` (o): add link parameter to the related Admin class when the ``Admin::generateUrl`` is called
-- ``code`` (o): the method name to retrieve the related value
+- ``code`` (o): the method name to retrieve the related value (for example,
+  if you have an `array` type field, you would like to show info prettier
+  than `[0] => 'Value'`; useful when simple getter is not enough).
+  Notice: works with string-like types (string, text, html)
 - ``associated_property`` (o): property path to retrieve the "string" representation of the collection element, or a closure with the element as argument and return a string.
 - ``identifier`` (o): if set to true a link appears on the value to edit the element