You can use the Bulk\ToggleAction
class to toggle the value of a boolean field for a group of database records.
<?php
namespace App\Controller;
class PostsController extends AppController
{
public function initialize()
{
parent::initialize();
$this->Crud->mapAction('toggleActive', [
'className' => 'Crud.Bulk/Toggle',
'field' => 'toggle',
]);
}
}
This is a list of events emitted from actions that extend Bulk\BaseAction
.
Please see the events documentation</events>
for a full list of generic properties and how to use the event system correctly.