Created
February 16, 2014 16:35
-
-
Save enzolutions/9036894 to your computer and use it in GitHub Desktop.
This file contains 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 | |
namespace Drupal\Blog\Controller; | |
use Drupal\Core\Controller\ControllerBase; | |
use Drupal\Core\DependencyInjection\ContainerInjectionInterface; | |
use Drupal\Core\Template\TwigEnvironment; | |
class DefaultController extends ControllerBase implements ContainerInjectionInterface { | |
protected $twig; | |
/** | |
* helloAction | |
* @param string $name Get | |
* @return [type] [description] | |
*/ | |
public function helloAction($name) { | |
return "Hello " . $name . "!"; | |
} | |
public function __construct(TwigEnvironment $twig) { | |
$this->twig = $twig; | |
} | |
public static function create(ContainerInterface $container){ | |
return new static( | |
$container->get('twig') ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment