Skip to content

Latest commit

 

History

History
44 lines (34 loc) · 1.18 KB

bulk-toggle.rst

File metadata and controls

44 lines (34 loc) · 1.18 KB

Bulk Toggle

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',
        ]);
    }
}

Configuration

Events

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.