From 3d41565ec4fdc6f98d41780c82677d2890bd6156 Mon Sep 17 00:00:00 2001 From: Lubos Remplik Date: Wed, 31 Aug 2016 14:12:27 +0200 Subject: [PATCH 1/2] Documentation for bulk actions, issue #144 --- docs/basic-usage.rst | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/docs/basic-usage.rst b/docs/basic-usage.rst index 0b195093..643de1c1 100644 --- a/docs/basic-usage.rst +++ b/docs/basic-usage.rst @@ -491,6 +491,29 @@ alter the ``contain()`` list for the pagination query: return $this->Crud->execute(); } +Bulk Actions +------------ + +There are bulk actions which can be easily used with crud view. + +To set up crud action in controller do something like this in initialize method. + +.. code-block:: php + $this->loadComponent('Crud.Crud', [ + 'actions' => [ + 'deleteAll' => [ + 'className' => 'Crud.Bulk/Delete', + ], + ] + ]); + +Then you need to config scaffold to display select with actions. + +.. code-block:: php + $action->config('scaffold.bulk_actions', [ + Router::url(['action' => 'deleteAll']) => __('Delete records'), + ]); + Going Forward ------------- From 5bc73a57795b2fc095c6d9b7328068344d791709 Mon Sep 17 00:00:00 2001 From: Lubos Remplik Date: Wed, 31 Aug 2016 16:29:14 +0200 Subject: [PATCH 2/2] Copy amends for bulk actions docs --- docs/basic-usage.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/basic-usage.rst b/docs/basic-usage.rst index 643de1c1..42558bd5 100644 --- a/docs/basic-usage.rst +++ b/docs/basic-usage.rst @@ -494,7 +494,7 @@ alter the ``contain()`` list for the pagination query: Bulk Actions ------------ -There are bulk actions which can be easily used with crud view. +The Crud plugin provides bulk actions which can be easily used with crud view. To set up crud action in controller do something like this in initialize method. @@ -507,7 +507,7 @@ To set up crud action in controller do something like this in initialize method. ] ]); -Then you need to config scaffold to display select with actions. +Then you need to configure scaffold to display select with actions. .. code-block:: php $action->config('scaffold.bulk_actions', [