Created
June 2, 2014 05:57
-
-
Save trq/53c7a91ae352eda21d64 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 SiteBundle\Controller; | |
use Symfony\Component\HttpFoundation\Response; | |
use Symfony\Component\HttpFoundation\Request; | |
use Symfony\Component\DependencyInjection\ContainerInterface; | |
use Symfony\Component\DependencyInjection\ContainerAwareInterface; | |
class CmsController implements ContainerAwareInterface | |
{ | |
private $container; | |
public function setContainer(ContainerInterface $container = null) | |
{ | |
$this->container = $container; | |
} | |
public function dynamicAction(Request $request) | |
{ | |
if ($request->attributes->has('_entity')) { | |
$page = $request->attributes->get('_entity'); | |
return $this->render($page->getTemplate(), $page); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment