src/Sulu/Bundle/SnippetBundle/Controller/SnippetController.php
public function getAction(Request $request, $id = null)
    {
        $locale = $this->getLocale($request);

        $snippet = $this->findDocument($id, $locale);
        $view = View::create($snippet);

        return $this->viewHandler->handle($view);
    }
public function getAction(Request $request, $id = null)
    {
        $locale = $this->getLocale($request);

        $snippet = $this->findDocument($id, $locale);
        $view = View::create($snippet);

        return $this->viewHandler->handle($view);
    }
public function getAction ( Request $ request , $ id = null ) { $ locale = $ this -> getLocale ( $ request ) ; $ snippet = $ this -> findDocument ( $ id , $ locale ) ; $ view = View :: create ( $ snippet ) ; return $ this -> viewHandler -> handle ( $ view ) ; }
Returns snippet by ID.

@param Request $request
@param string $id

@return \Symfony\Component\HttpFoundation\Response

@Get(defaults={"id" = ""})
Returns snippet by ID .