You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Web/Documentation/content/main/1-essentials/03-views.md
+4-6Lines changed: 4 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,17 +5,15 @@ description: "Tempest provides a modern templating engine with syntax inspired b
5
5
6
6
## Overview
7
7
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.
9
9
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.
11
11
12
12
### Syntax overview
13
13
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
-
16
14
The following is an example of a view that inherits the `x-base` component, passing a `title` property.
17
15
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 `:`.
19
17
20
18
```html
21
19
<x-basetitle="Home">
@@ -39,7 +37,7 @@ Inside, a `x-post` component is rendered multiple times thanks to a foreach loop
39
37
40
38
## Rendering views
41
39
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.
0 commit comments