diff --git a/docs/basic-usage.rst b/docs/basic-usage.rst index 0b195093..42558bd5 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 +------------ + +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. + +.. code-block:: php + $this->loadComponent('Crud.Crud', [ + 'actions' => [ + 'deleteAll' => [ + 'className' => 'Crud.Bulk/Delete', + ], + ] + ]); + +Then you need to configure scaffold to display select with actions. + +.. code-block:: php + $action->config('scaffold.bulk_actions', [ + Router::url(['action' => 'deleteAll']) => __('Delete records'), + ]); + Going Forward -------------