I create a custom module in Drupal 8. It install/uninstall smoothly. But when I try to access that module then I’m getting that message
"Page Not Found." -
Failed to load resource: the server responded with a status of 404 (Not Found)
For debuging I made these entries in my setting.php file.
error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);
$conf['error_level'] = 2;
But getting no luck. Is there any other ways to debug my code in drupal 8.
Here is my routing file code:
custom_module.admin:
path: '/admin/custom_module'
defaults:
_controller: 'Drupalcustom_moduleCustomModuleController::custInformation'
_title: 'Custom Module Title'
requirements:
_permission: 'access information'
custom_module.site_page:
path: '/custom_module'
defaults:
_title: 'Custom Module Title'
_controller: 'Drupalcustom_moduleCustomModuleController::custInformation'
requirements:
_permission: 'access information'
and link.menu.yml file code:
custom_module.admin:
title: 'Custom Module Title'
parent: system.admin
description: 'Brief description.'
route_name: custom_module.admin
custom_module.site_page:
title: 'Custom Module Title'
route_name: custom_module.site_page
menu_name: footer
enabled: 0
& controller file
namespace Drupalcustom_moduleController;
use DrupalCoreControllerControllerBase;
/**
* Controller routines for contact routes.
*/
class CustomModuleController extends ControllerBase {
/**
* Render a list of entries in the database.
*/
public function custInformation() {
$header = array('Name');
$rows[] = array("John");
$content['table_brief'] = array(
'#type' => 'table',
'#header' => $header,
'#rows' => $rows,
'#empty' => t('No entries available.'),
);
return $content;
}
}