浏览代码

fixup! Add batch action documentation.

Romain Geissler 13 年之前
父节点
当前提交
f33f69ff5e
共有 1 个文件被更改,包括 8 次插入0 次删除
  1. 8 0
      Resources/doc/reference/batch_actions.rst

+ 8 - 0
Resources/doc/reference/batch_actions.rst

@@ -11,6 +11,8 @@ You can easily add some custom batch action in the list view. By default the ``d
 Override the ``getBatchActions`` from your ``Admin`` class to define custom batch actions. For example, we define here a new ``merge`` action.
 
 .. code-block:: php
+    <?php
+
     // In your Admin class
 
     public function getBatchActions()
@@ -52,6 +54,8 @@ Obviously, a merge action requires two kind of selection : a set of source model
 And add this:
 
 .. code-block:: php
+    <?php
+
     // In Acme/ProjectBundle/AcmeProjectBundle.php
 
     public function getParent()
@@ -70,6 +74,8 @@ By default, batch actions are not executed if no model was selected, and the use
  - ``false``: Same as above, with the default "action aborted, no model selected" notification message.
 
 .. code-block:: php
+    <?php
+
     // In Acme/Controller/CRUDController.php
 
     public function batchActionMergeIsRelevant(array $normalizedSelectedIds, $allEntitiesSelected)
@@ -108,6 +114,8 @@ Define the core action logic
 The method ``batchActionMyAction`` will be executed to achieve the core logic. The selected models are passed to the method through a query argument retrieving them. If for some reason it makes sense to perform your batch action without the default selection method (for example you defined another way, at template level, to select model at a lower granularity), the passed query is ``null``.
 
 .. code-block:: php
+    <?php
+
     // In Acme/Controller/CRUDController.php
 
     public function batchActionMerge(ProxyQueryInterface $selectedModelQuery)