I am looking for best implementation of following case.
In my some view I have
- a \atk4\ui\Grid and
- A Class public variable containing array
array (size=2) ‘Active’ => array (size=4) ‘view’ => boolean true ‘edit’ => boolean true ‘delete’ => array (size=1) 0 => string ‘4’ (length=1) ‘deactivate’ => boolean false ‘InActive’ => array (size=4) ‘view’ => boolean false ‘edit’ => boolean false ‘delete’ => boolean false ‘activate’ => boolean false
Basically, this array contains Various status of a model and what action user is allowed to take on that status. ‘view’, ‘edit’,‘delete’ is not of concerned now but deactivate/activate is the catch here.
My Query is How do I create and add such Decorator that adds Menu/DropDown on status column showing Status and DropDown Opens Menu based on that public array logic.
The underdevelopment Controller is at https://github.com/we-nebula/ecomm/blob/master/development/we-nebula/ecomm/src/Controller/Acl.php and is a recreation of our 4.3 ACL Controller in Atk4\ui.
Best Practice Direction needed …