I get this error with the ATK 9 framework
class
App\Modules\Auth\Module
contains 1 abstract method and must therefore be declared abstract or implement the remaining methods
calling the below class:
abstract class Module
{
public static $module;
/** @var Atk $atk */
private $atk;
/** @var Menu $menu */
private $menu;
public function __construct(Atk $atk, Menu $menu)
{
$this->atk = $atk;
$this->menu = $menu;
}
protected function getMenu()
{
return $this->menu;
}
protected function getAtk()
{
return $this->atk;
}
abstract public function register();
public function boot()
{
//noop
}
public function registerNode($nodeName, $nodeClass, $actions = null)
{
$this->atk->registerNode(static::$module.'.'.$nodeName, $nodeClass, $actions);
}
public function addNodeToMenu($menuName, $nodeName, $action, $parent = 'main', $enable = null, $order = 0, $navbar = 'left')
{
if ($enable === null) {
$enable = [static::$module.'.'.$nodeName, $action];
}
$this->menu->addMenuItem($menuName, Tools::dispatch_url(static::$module.'.'.$nodeName, $action), $parent, $enable, $order, static::$module, '', $navbar);
}
public function addMenuItem($name = '', $url = '', $parent = 'main', $enable = 1)
{
$this->menu->addMenuItem($name, $url, $parent, $enable, 0, static::$module);
}
}
this is the code i use to call the class Module:
class Module extends \Sintattica\Atk\Core\Module
{
static $module = 'auth';
public function boot()
{
$this->registerNode('users', Users::class, ['admin', 'add', 'edit', 'delete']);
$this->registerNode('groups', Groups::class, ['admin', 'add', 'edit', 'delete']);
$this->registerNode('users_groups', UsersGroups::class);
$this->addMenuItem('auth');
$this->addNodeToMenu('users', 'users', 'admin', 'auth');
$this->addNodeToMenu('groups', 'groups', 'admin', 'auth');
}
}
thanks