Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Action methods should accept the event data argument, containing input from the UI (e.g. attributes, item id, etc.).

Code example

 

Code Block
languagexmlphp
class BasicappPanelActions extends \Innomatic\Desktop\Panel\PanelActions {
    public function __construct(\Innomatic\Desktop\Panel\PanelController $controller) {
        parent::__construct($controller);
    }
    public function beginHelper() {}
    public function endHelper() {}
 
  public function executeDeleteItem($eventData) {
    $this->dataAccess->execute(‘DELETE FROM my_items WHERE ID=‘.$eventData[‘id’]);
  }
}

...

Helpers

The panel view actions also supports a begin and end helper that are called just before and after a view is executed.

Code Block
languagexmlphp
public function beginHelper() {
    $this->localeCatalog = new \Innomatic\Locale\LocaleCatalog(
        'example-basic-app::panel',
        $this->container->getCurrentUser()->getLanguage()
    );
}
 
public function endHelper() {
}