Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace AppBundle\Controller;
- use Symfony\Bundle\FrameworkBundle\Controller\Controller;
- class BaseGalleryController extends Controller
- {
- /**
- * Shortcut to return the JMSSerializer service.
- *
- * @return object The service
- *
- * @throws \LogicException If JMSSerializerBundle is not available
- */
- public function getSerializer()
- {
- if (!$this->container->has('jms_serializer')) {
- throw new \LogicException('The JMSSerializerBundle is not registered in your application.');
- }
- return $this->container->get('jms_serializer');
- }
- // ... another shortcuts, if needed
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement