Define User Action
UI Integration
Crud integration

Agile UI introduces a new set of views called "User Action Executors". Their job is to recognise all that meta-information that you have specified for the user action and requesting it from the user. "edit" user action is defined for models by default and you can trigger it on button-click with a very simple code:

$country = new Country($owner->getApp()->db);
$country = $country->loadAny();

Button::addTo($owner, ['Edit some country'])
    ->on('click', $country->getUserAction('edit'));
Edit some country

It is not only the button, but any view can have "User Action" passed as a second step of the on() call. Here the user action is executed when you click on "World" menu item:

$country = new Country($owner->getApp()->db);
$country = $country->loadAny();

$menu = Menu::addTo($owner);
$menu->addItem('World', $country->getUserAction('edit'));