Interface luya\base\AdminModuleInterface

Implemented byluya\admin\Module, luya\admin\base\Module, luya\cms\admin\Module
Available since version1.0.0
Source Code https://github.com/luyadev/luya/blob/master/core/base/AdminModuleInterface.php

Defines a module as Admin Module.

All administration modules must implement the AdminModuleInterface, this allows LUYA to deliver modules on the area the are used. Some modules are only used in frontend others are just in administration context those modules must implement AdminModuleInterface.

Public Methods

Hide inherited methods

Method Description Defined By
getAdminAssets() Returns all Asset files to registered in the administration interfaces. luya\base\AdminModuleInterface
getJsTranslationMessages() Returns all message identifier for the current module which should be assigned to the javascript admin interface. luya\base\AdminModuleInterface
getMenu() The menu object from the {{\luya\admin\components\AdminMenuBuilder}} class in order to store and build the administration module menu elements. luya\base\AdminModuleInterface

Method Details

Hide inherited methods

getAdminAssets() public abstract method

Returns all Asset files to registered in the administration interfaces.

As the adminstration UI is written in angular, the assets must be pre assigned to the adminisration there for the getAdminAssets() method exists.

public function getAdminAssets()
{
    return [
         'luya\admin\assets\Main',
         'luya\admin\assets\Flow',
    ];
}
public abstract array getAdminAssets ( )
return array

An array with with assets files where the array has no key and the value is the path to the asset class.

                public function getAdminAssets();

            
getJsTranslationMessages() public abstract method

Returns all message identifier for the current module which should be assigned to the javascript admin interface.

As the administration UI is written in angular, translations must also be available in different javascript section of the page.

The response array of this method returns all messages keys which will be assigned:

Example:

public function getJsTranslationMessages()
{
    return ['js_ngrest_rm_page', 'js_ngrest_rm_confirm', 'js_ngrest_error'],
}

Assuming the aboved keys are also part of the translation messages files.

In the javascript code you can access assigned js translation message like followed:

i18n['js_ngrest_rm_page'];
public abstract array getJsTranslationMessages ( )
return array

An array with values of the message keys based on the Yii translation system.

                public function getJsTranslationMessages();

            
getMenu() public abstract method

The menu object from the {{\luya\admin\components\AdminMenuBuilder}} class in order to store and build the administration module menu elements.

public abstract false|luya\admin\components\AdminMenuBuilderInterface getMenu ( )

                public function getMenu();