From 6dcc2f56a0a4be80962fb4ce0c09d5ed0c1b5ad8 Mon Sep 17 00:00:00 2001 From: ROllerozxa Date: Mon, 7 Aug 2023 22:31:18 +0200 Subject: [PATCH] Add Twig page --- _wiki/Twig.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 _wiki/Twig.md diff --git a/_wiki/Twig.md b/_wiki/Twig.md new file mode 100644 index 0000000..e92c119 --- /dev/null +++ b/_wiki/Twig.md @@ -0,0 +1,12 @@ +--- +title: Twig +--- + +Twig is the name of the templating engine used by Cirrusboard. For documentation about Twig, see [their website](https://twig.symfony.com/doc/3.x/). + +All pages in Cirrusboard use the `twigloader()` function which loads Twig along with Cirrusboard-specific extensions. Templates are read from the `templates/` directory. + +## Clearing Twig cache +Twig works by compiling the template files into raw PHP that then gets executed. These compiled files can be cached to reduce the overhead of the templating engine. This also means that changes you make to the Twig templates won't immediately take effect unless you clear the Twig cache. If your Twig cache is at the default location, then `./tools/clear-cache.sh` can be used to clear it. + +If you're doing more serious development then you would want to set `$tplNoCache` which completely disables the cache and will always compile the template.