main/core/Controller/ResourceController.php
public function embedAction(ResourceNode $resourceNode)
    {
        $mimeType = explode('/', $resourceNode->getMimeType());

        $view = 'default';
        if ($mimeType[0] && in_array($mimeType[0], ['video', 'audio', 'image'])) {
            $view = $mimeType[0];
        }

        return new Response(
            $this->templating->render("ClarolineCoreBundle:resource:embed/{$view}.html.twig", [
                'resource' => $this->manager->getResourceFromNode($resourceNode),
            ])
        );
    }
public function embedAction(ResourceNode $resourceNode)
    {
        $mimeType = explode('/', $resourceNode->getMimeType());

        $view = 'default';
        if ($mimeType[0] && in_array($mimeType[0], ['video', 'audio', 'image'])) {
            $view = $mimeType[0];
        }

        return new Response(
            $this->templating->render("ClarolineCoreBundle:resource:embed/{$view}.html.twig", [
                'resource' => $this->manager->getResourceFromNode($resourceNode),
            ])
        );
    }
public function embedAction ( ResourceNode $ resourceNode ) { $ mimeType = explode ( '/' , $ resourceNode -> getMimeType ( ) ) ; $ view = 'default' ; if ( $ mimeType [ 0 ] && in_array ( $ mimeType [ 0 ] , [ 'video' , 'audio' , 'image' ] ) ) { $ view = $ mimeType [ 0 ] ; } return new Response ( $ this -> templating -> render ( "ClarolineCoreBundle:resource:embed/{$view}.html.twig" , [ 'resource' => $ this -> manager -> getResourceFromNode ( $ resourceNode ) , ] ) ) ; }
Embeds a resource inside a rich text content.

@EXT\Route("/embed/{id}", name="claro_resource_embed_short")
@EXT\Route("/embed/{type}/{id}", name="claro_resource_embed")

@param ResourceNode $resourceNode

@return Response
Embeds a resource inside a rich text content .