Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class AmpController extends Controller
- {
- /**
- * @Route("/ez-amp/{objectId}", name="ez_amp")
- */
- public function viewObjectAction($objectId)
- {
- $contentService = $this->get('ezpublish.api.service.content');
- $contentTypeService = $this->get('ezpublish.api.service.contenttype');
- $contentObject = $contentService->loadContent($objectId);
- $contentType = $contentTypeService->loadContentType($contentObject->versionInfo->contentInfo->contentTypeId);
- $params = array('content' => $contentObject);
- return $this->render('amp/' . $contentType->identifier . '.html.twig', $params);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement