Skip to content

Instantly share code, notes, and snippets.

@wouterj
Created December 30, 2015 12:28
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 wouterj/c208b2ba71f449b66978 to your computer and use it in GitHub Desktop.
Save wouterj/c208b2ba71f449b66978 to your computer and use it in GitHub Desktop.
<?php
class PostController extends Controller
{
public function showAction($slug, $_template)
{
$post = $this->someBackend->findBySlug($slug);
return $this->render($_template, ['post' => $post]);
}
}
some_route:
path: /blog/{slug}
defaults:
_controller: App:Post:show
_template: post/single.html.twig
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment