Skip to content

Commit a2de3b7

Browse files
committed
wip
1 parent 740a368 commit a2de3b7

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

docs/1-essentials/02-views.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,11 @@ description: "Tempest provides a modern templating engine with syntax inspired b
44
keywords: "Experimental"
55
---
66

7-
:::warning
8-
Tempest View is currently experimental and is not covered by our backwards compatibility promise.
9-
:::
10-
117
## Overview
128

13-
Views in Tempest are parsed by Tempest View, our own templating engine. Tempest View uses a syntax that can be thought of as a superset of HTML. 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.
9+
Views in Tempest are parsed by Tempest View, our own templating engine. Tempest View uses a syntax that can be thought of as a superset of HTML. 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.
10+
11+
If you'd like to Tempest View as a standalone component in your project, you can read the documentation on how to do so [here](../5-extra-topics/02-standalone-components.md#tempest-view).
1412

1513
### Syntax overview
1614

docs/5-extra-topics/02-standalone-components.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ ld($variable);
9797

9898
## `tempest/view`
9999

100-
Tempest's view renderer can be used to render views.
100+
Tempest View can be used as a standalone package:
101101

102102
```
103103
composer require tempest/view
@@ -111,6 +111,12 @@ $view = view(__DIR__ . '/src/b.view.php');
111111
echo $container->get(ViewRenderer::class)->render($view);
112112
```
113113

114+
There are a couple of notes to make when running Tempest View as a standalone component:
115+
116+
- Any view files and components will be discovered and must be in a directory with a valid PSR-4 namespace. View files themselves don't need to have a namespace, though.
117+
- View files are compiled and cached. You can manually enable or disable this cache by setting the `{env}{:hl-keyword:VIEW_CACHE:}` environment variable to `true` or `false`. By default, the view cache is disabled.
118+
- Optionally, you can require `tempest/console`, which will provide you with the `vendor/bin/tempest view:clear` command to clear view caches. If you don't install `tempest/console`, you'll have to manually clear view caches on deployment by removing the `.tempest/cache/views` directory.
119+
114120
## `tempest/event-bus`
115121

116122
Tempest's event bus can be used as a standalone package, in order for event handlers to be discovered, you'll have to boot Tempest's kernel and resolve the event bus from the container:

0 commit comments

Comments
 (0)