Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@pedroresende
Created May 19, 2018 18:08
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 pedroresende/1801efb8645debded668b8128aef0bb7 to your computer and use it in GitHub Desktop.
Save pedroresende/1801efb8645debded668b8128aef0bb7 to your computer and use it in GitHub Desktop.
<?php
// src/Controller/HomeController.php
namespace App\Controller;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use App\Service\ConfigGenerator;
use App\Service\StoreFactory;
class HomeController
{
private $config;
private $store;
public function __construct(ConfigGenerator $config, StoreFactory $store)
{
$this->config = $config;
$this->store = $store;
}
/**
* @Route("/")
*/
public function index()
{
$number = mt_rand(0, 100);
$config->get();
return new Response('<html><body>x</body></html>');
#$this->render('lucky.twig', array( 'number' => $store->id,));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment