Skip to content

Instantly share code, notes, and snippets.

@jmolivas
Last active February 4, 2016 22:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmolivas/950addf854ad750a52f1 to your computer and use it in GitHub Desktop.
Save jmolivas/950addf854ad750a52f1 to your computer and use it in GitHub Desktop.
Module of the week
example.hello_controller_hello:
path: 'example/hello/{name}'
defaults:
_controller: '\Drupal\example\Controller\HelloController::hello'
_title: 'Hello'
requirements:
_permission: 'access content'
<?php
/**
* @file
* Contains \Drupal\example\Controller\HelloController.
*/
namespace Drupal\example\Controller;
use Drupal\Core\Controller\ControllerBase;
/**
* Class HelloController.
*
* @package Drupal\example\Controller
*/
class HelloController extends ControllerBase {
/**
* Hello.
*
* @return string
* Return Hello string.
*/
public function hello($name) {
return [
'#type' => 'markup',
'#markup' => $this->t("Implement method: hello with parameter(s): $name")
];
}
}
commands:
# Download Drupal
- command: site:new
arguments:
directory: drupal8.dev
version: 8.0.3
# Install Drupal
- command: site:install
options:
langcode: en
db-type: sqlite
db-file: sites/default/files/.ht.sqlite
site-name: 'Drupal 8 Quick Start'
site-mail: admin@example.com
account-name: admin
account-mail: admin@example.com
account-pass: admin
arguments:
profile: standard
# Start php built-in server
- command: server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment