A quick look at one way to use the same controller action and Twig template (or just template) for displaying a full page and also just the inner content for an Ajax request in a Symfony2 application. This is using the ability to set which template a twig template extends from dynamically (which is shown here in the Twig documentation). So assuming we have a current inner template that looks like
![Symfony2: Ajax and Full Page Templates](https://cdn-ak-scissors.b.st-hatena.com/image/square/2f1543f63b6ff533493840d12dde6ebeb9eea370/height=288;version=1;width=512/https%3A%2F%2Frichardmiller.co.uk%2Fcontent%2Fimages%2Fsize%2Fw1200%2F2014%2FApr%2Fcurbar2.jpg)