Skip to content

Commit 70d40e7

Browse files
committed
feat: slightly improve views' overview
1 parent 903814a commit 70d40e7

File tree

1 file changed

+4
-6
lines changed
  • src/Web/Documentation/content/main/1-essentials

1 file changed

+4
-6
lines changed

src/Web/Documentation/content/main/1-essentials/03-views.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,15 @@ description: "Tempest provides a modern templating engine with syntax inspired b
55

66
## Overview
77

8-
Tempest uses its own templating engine, Tempest View, as the default. Its syntax is based on HTML, and is always syntactically valid HTML. Under the hood, Tempest uses [PHP 8.4's DOM parser](https://www.php.net/manual/en/book.dom.php) to parse templates before compiling them.
8+
Views in Tempest use a syntax that can be thought of as a superset of HTML. Under the hood, [PHP 8.4's DOM parser](https://www.php.net/manual/en/book.dom.php) is used to parse templates before compiling them.
99

10-
If you prefer using templating engines that have more widespread support, you may also use Blade, Twig, or any other engine, as long as you provide a way to initialize it. To do so, refer to the [related documentation](#using-other-engines).
10+
If you prefer using a templating engine with more widespread support, [you may also use Blade, Twig, or any other](#using-other-engines)as long as you provide a way to initialize it.
1111

1212
### Syntax overview
1313

14-
Tempest views' syntax can be thought of as a superset of HTML. The control flow is implemented using HTML attributes that start with colons `:`.
15-
1614
The following is an example of a view that inherits the `x-base` component, passing a `title` property.
1715

18-
Inside, a `x-post` component is rendered multiple times thanks to a foreach loop on `$this->posts`. That component has a default slot, in which the post details are rendered.
16+
Inside, a `x-post` [component](#view-components) is rendered multiple times thanks to a [foreach loop](#foreach-and-forelse) on `$this->posts`. That component has a default [slot](#using-slots), in which the post details are rendered. The [control flow](#control-flow-directives) is implemented using HTML attributes that start with colons `:`.
1917

2018
```html
2119
<x-base title="Home">
@@ -39,7 +37,7 @@ Inside, a `x-post` component is rendered multiple times thanks to a foreach loop
3937

4038
## Rendering views
4139

42-
As specified in the documentation about [sending responses](./02-routing#view-responses), views may be returned from controller actions using the `{php}view()` function. This function is a shorthand for instanciating a {`\Tempest\View\View`} object.
40+
As specified in the documentation about [sending responses](./02-routing#view-responses), views may be returned from controller actions using the `{php}view` function. This function is a shorthand for instantiating a {`\Tempest\View\View`} object.
4341

4442
```php app/AircraftController.php
4543
use Tempest\Router\Get;

0 commit comments

Comments
 (0)