title: Symfony 3 FOSRestBundle Twig - not render
body: <p>I am trying to setup API to use it in SPA but I can't see the twig template in browser the only think I get is $data response.</p>
  
  <p>Where in config I should specify the template?
  Where exactly should I put templates?</p>
  
  <p><strong>AppBundle/Controller/DefaultController.php</strong></p>
  
  <pre><code>namespace AppBundle\Controller;
  
  use Symfony\Component\HttpFoundation\Request;
  use FOS\RestBundle\View\View;
  
  class DefaultController
  {
      /**
       * @Route("/", name="homepage")
       *
       */
      public function indexAction(Request $request)
      {
          $data = 'string';
          $view = View::create();
          $view
              -&gt;setData($data)
              -&gt;setTemplate("default/index.html.twig");
  
          return $view;
      }
  }
  </code></pre>
  
  <p><strong>config.yml</strong></p>
  
  <pre><code>#Nelmio CORS
  nelmio_cors:
      defaults:
          allow_origin:  ["%cors_allow_origin%"]
          allow_methods: ["POST", "PUT", "GET", "DELETE", "OPTIONS"]
          allow_headers: ["content-type", "authorization"]
          max_age:       3600
      paths:
          '^/': ~
  
  # FOS REST Bundle
  fos_rest:
      body_listener: true
      format_listener:  true
      param_fetcher_listener: true
      view:
          default_engine: twig
          view_response_listener: 'force'
          exception_wrapper_handler:  null
          formats:
              jsonp: true
              json: true
              xml: false
              rss: false
          templating_formats:
              html: true
          mime_types:
              json: ['application/json', 'application/x-json']
              jpg: 'image/jpeg'
              png: 'image/png'
          jsonp_handler: ~
      routing_loader:
          default_format:  json
          include_format:  false
      format_listener:
          rules:
              - { path: ^/, priorities: [ json, jsonp ], fallback_format: html, prefer_extension: true }
      exception:
          enabled: true
  </code></pre>