From e514a876c23759dbd4f30d94f26421c8dcf54dc9 Mon Sep 17 00:00:00 2001 From: Bachir Soussi Chiadmi Date: Mon, 25 Mar 2019 18:28:17 +0100 Subject: [PATCH] started materio_home module --- .../materio_home/includes/materio_home.inc | 7 ++++ .../custom/materio_home/materio_home.info.yml | 6 ++++ .../custom/materio_home/materio_home.module | 16 +++++++++ .../materio_home/materio_home.routing.yml | 23 ++++++++++++ .../src/Controller/HomeController.php | 35 +++++++++++++++++++ .../templates/materio-home.html.twig | 1 + 6 files changed, 88 insertions(+) create mode 100644 web/modules/custom/materio_home/includes/materio_home.inc create mode 100644 web/modules/custom/materio_home/materio_home.info.yml create mode 100644 web/modules/custom/materio_home/materio_home.module create mode 100644 web/modules/custom/materio_home/materio_home.routing.yml create mode 100644 web/modules/custom/materio_home/src/Controller/HomeController.php create mode 100644 web/modules/custom/materio_home/templates/materio-home.html.twig diff --git a/web/modules/custom/materio_home/includes/materio_home.inc b/web/modules/custom/materio_home/includes/materio_home.inc new file mode 100644 index 00000000..ab442ffb --- /dev/null +++ b/web/modules/custom/materio_home/includes/materio_home.inc @@ -0,0 +1,7 @@ + array( + // 'render element' => '', + 'file' => 'includes/materio_home.inc', + 'variables' => array(), + ), + ); +} diff --git a/web/modules/custom/materio_home/materio_home.routing.yml b/web/modules/custom/materio_home/materio_home.routing.yml new file mode 100644 index 00000000..c45c141f --- /dev/null +++ b/web/modules/custom/materio_home/materio_home.routing.yml @@ -0,0 +1,23 @@ +materio_home.home: + path: '/home' + defaults: + _controller: '\Drupal\materio_home\Controller\HomeController::home' + _title: 'Home' + requirements: + _permission: 'access content' + +# materio_home.home_mobile: +# path: '/home_m' +# defaults: +# _controller: '\Drupal\materio_home\Controller\HomeController::home_mobile' +# _title: 'Home' +# requirements: +# _permission: 'access content' +# +# materio_home.home_mobileajax: +# path: '/home_m/ajax' +# defaults: +# _controller: '\Drupal\materio_home\Controller\HomeController::home_mobilejson' +# _title: 'Home' +# requirements: +# _permission: 'access content' diff --git a/web/modules/custom/materio_home/src/Controller/HomeController.php b/web/modules/custom/materio_home/src/Controller/HomeController.php new file mode 100644 index 00000000..b4f44f8f --- /dev/null +++ b/web/modules/custom/materio_home/src/Controller/HomeController.php @@ -0,0 +1,35 @@ +getViewBuilder('node'); + + $contents = array("#theme"=>'materio_home'); + + return $contents; + } + + +} diff --git a/web/modules/custom/materio_home/templates/materio-home.html.twig b/web/modules/custom/materio_home/templates/materio-home.html.twig new file mode 100644 index 00000000..fe657f08 --- /dev/null +++ b/web/modules/custom/materio_home/templates/materio-home.html.twig @@ -0,0 +1 @@ +Hello Materio :)