# How do I change the response view?

For responses that return HTML, a Twig view file is used. Whilst these are originally defined, the view can be changed. For example, to change the product page view based on product data:

```php
\Aero\Store\Http\Responses\ProductPage::extend(function (\Aero\Store\Http\Responses\ProductPage $page, \Closure $next) {
    if ($view = $page->product->additional('view')) {
        $page->setView($view);
    }

    return $next($page);
});
```

<p class="callout info">Setting the view to `null` will result in a JSON response.</p>

<p class="callout info">You can get the current view for a response using `getView()`.</p>