Skip to content

Instantly share code, notes, and snippets.

@theodesp
Created December 7, 2019 15:31
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 theodesp/ebb598804ada11a67af47fe988ffcaa3 to your computer and use it in GitHub Desktop.
Save theodesp/ebb598804ada11a67af47fe988ffcaa3 to your computer and use it in GitHub Desktop.
<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Translation\TranslatorInterface;
class ExampleController extends AbstractController
{
/**
* @Route(/example, name="homepage")
*/
public function index(TranslatorInterface $translator, $locales, $defaultLocale)
{
return $this->render('example.html.twig', [
'date' => date(DATE_RFC2822),
'number' => 13123123,
'price' => 1500
]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment