Reference link: http://www.drupalwoo.com/content/blog/my-first-drupal-8-module
module_name.info.yml
name: module_name description: 'A module for making online module_name.' type: module core: 8.x package: Custom version: 8.x
module_name.routing.yml
module_name_report: path: 'admin/module_name' defaults: _title: 'module_name Reports' _controller: '\Drupal\module_name\Controller\module_nameController::module_nameReport' requirements: _permission: 'access content'
module_name_myschool: path: 'admin/module_name/myschool' defaults: _title: 'My School module_name Reports' _controller: '\Drupal\module_name\Controller\module_nameController::mymodule_nameReport' requirements: _permission: 'access content'
module_name_allschool: path: 'admin/module_name/allschool' defaults: _title: 'All School module_name Reports' _controller: '\Drupal\module_name\Controller\module_nameController::allmodule_nameReport' requirements: _permission: 'access content'
module_name_getpsms: path: 'admin/module_name/getpsms' defaults: _title: 'All School psms Reports' _controller: '\Drupal\module_name\Controller\module_nameController::allabcdReport' requirements: _permission: 'access content'
module_name.module.yml
array( 'title'=>'module_name Reports', 'route_name' => 'module_name_report', ), 'admin/module_name/myschool' => array( 'title'=>'My module_name Reports', 'route_name' => 'module_name_myschool', ), 'admin/module_name/allschool' => array( 'title'=>'All module_name Reports', 'route_name' => 'module_name_allschool', ), 'admin/module_name/getpsms' => array( 'title'=>'All abcd Reports', 'route_name' => 'module_name_getpsms', ),
);
}
/** * Implementation of hook_permission(). */
/* function module_name_permission() { return array( 'administer module_name' => array( 'title' => t('Administer module_name'), 'description' => t('Administer Student module_name.'), ),
'access module_name' => array(
'title' => t('Access module_name'),
'description' => t('Access Student module_name.'),
),
'create module_name' => array(
'title' => t('Create module_name'),
'description' => t('Create Student module_name.'),
),
'administer module_name reports' => array(
'title' => t('Administer module_name Reports'),
'description' => t('Administer Student module_name Reports.'),
),
); }*/
module_name.controller.php
namespace Drupal\enquiry\Controller;
use Drupal\Core\Controller\ControllerBase;
/** * Route controller for module_name. */ class module_nameController extends ControllerBase {
/**
* Implementation of hook_help().
*/
public function enquiryHelp($path, $arg) {
}
/**
* Implementation of hook_init().
*/
public function module_nameInit() {
}
/** * Displays a enquiry report. */ public function module_nameReport() {
}
public function mymodule_nameReport(){
}
public function allmodule_nameReport() { }
public function allabcdReport() {
}
folder structure
module_name src - controller: module_name.controller.php module_name.info.yml module_name.module.yml module_name.routing.yml
My question:
module showing "Extend" list. after install the module not showing permission from role/permission area. Performance also not happening from configuration tab.