# Sage 10 - how to return blade templates from setup.php for custom shortcodes?

**URL:** https://discourse.roots.io/t/sage-10-how-to-return-blade-templates-from-setup-php-for-custom-shortcodes/20538
**Category:** sage
**Tags:** blade, sage10
**Created:** 2021-04-06T03:43:55Z
**Posts:** 18
**Showing post:** 2 of 18

## Post 2 by @strarsis — 2021-04-06T04:00:01Z

In Sage 10 `Roots\view` is responsible for rendering:

```
view('subfolder/some-template-file', [ // no file extension (`blade.php`)
        'some_parameter' => 'test123',
    ])->render();
```

The path to the template file is relative to the `resources/views` directory of the Sage 10 theme directory.  
The constructor results in a `View` object whose `render` method returns the rendered template.

Tip: Add `use function Roots\view;` at the beginning of the PHP file so you can just use `view(...)` instead explicitly typing out the `Roots` namespace.

---

_[View the full topic](https://discourse.roots.io/t/sage-10-how-to-return-blade-templates-from-setup-php-for-custom-shortcodes/20538)._
