atk4 / mastercrud

Manipulates ATK CRUD through the force of references
https://atk4.org
MIT License
9 stars 7 forks source link

Add column actions #9

Closed romaninsh closed 6 years ago

romaninsh commented 6 years ago

Added support for 'columnActions':

screen shot 2018-07-11 at 13 11 01
$app->layout->add(new \atk4\mastercrud\MasterCRUD())
    ->setModel(new \saasty\Model\App($app->db), 
    [
        'columnActions'=>[
            'repair'=>'wrench',
        ],
        'Models'=>[
            'columnActions'=>[
                'migrate'=>'database',
            ],
            'Fields'=>[
                'ValidationRules'=>[],

            ],
            'Relations'=>[
                'ImportedFields'=>[],
            ],
        ],

there are various invocation methods allowing you to specify icon, label, custom callbacks etc.

This also adds "MethodInvocator" - a view which asks you for arguments and then executes them.

This next example will use form to ask for an email, which will then be passed as argument to sendEmail($email)

[
    'columnActions'=>[
         'sendEmail' => ['icon'=>'wrench', 'email'=>'string']
   ]
]
DarkSide666 commented 6 years ago

Looks and works good. I think this can be merged in.