-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: Add documentation to index page surrounding bulk actions
Closes #183
- Loading branch information
1 parent
4bf2572
commit af6be60
Showing
3 changed files
with
29 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
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', | ||
], | ||
] | ||
]); | ||
Once a bulk action has been mapped, the ``scaffold.bulk_actions`` configuration | ||
key can be specified. The ``scaffold.bulk_actions`` configuration key takes an | ||
array of key/value pairs, where the key is the url and the value is the title. | ||
|
||
.. code-block:: php | ||
$action = $this->Crud->action(); | ||
$action->config('scaffold.bulk_actions', [ | ||
Router::url(['action' => 'deleteAll']) => __('Delete records'), | ||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters