# Views

Tea is focused more on APIs than views, but you can still return views:

public function home()
{
    return view('pages.home', ['name' => 'Teodora']);
}
1
2
3
4

All your views live under /resources/views. Thus /resources/views must be omitted when you link to a view. Instead you can simply pass the directory (if any) and then the name of the view without any extension.

A second parameter can be passed, to pass data to the view.

In case you pass data to a view, you can print the data by accessing its name, surrounded by double curly braces.

<span>
    {{ $name }}
</span>
1
2
3

Don't try to use arrays or objects, it won't work and there is no plan to support views in the near future, since Tea is an API based framework.