Created
April 10, 2017 06:07
-
-
Save gargsuchi/f1e7276f26c7d152f74b295ca586df73 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Lotus | |
type: module | |
description: Lotus module - Task-02 Create a custom page with arguments | |
core: 8.x | |
package: Acquia Learning |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lotus.offers_controller_hello: | |
path: '/offers/hot/{count}' | |
defaults: | |
_controller: '\Drupal\lotus\Controller\OffersController::hello' | |
_title: 'Offers' | |
requirements: | |
_permission: 'access content' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Controller file for Lotus Drupal 8 module. | |
* Place this file in src/Controller folder inside the lotus module folder | |
**/ | |
namespace Drupal\lotus\Controller; | |
use Drupal\Core\Controller\ControllerBase; | |
/** | |
* Class OffersController. | |
* | |
* @package Drupal\lotus\Controller | |
*/ | |
class OffersController extends ControllerBase { | |
/** | |
* Hello. | |
* | |
* @return string | |
* Return Hello string. | |
*/ | |
public function hello($count) { | |
return [ | |
'#type' => 'markup', | |
'#markup' => $this->t('You will get %count% discount!!', array('%count' => $count)), | |
]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment