Flags
Zing\Flags defines constants that control how the engine compiles and caches templates. Combine them with |:
use Zing\Engine;
use Zing\Flags;
$engine = new Engine(
viewPath: __DIR__ . '/resources/views',
cachePath: __DIR__ . '/storage/zing-cache',
flags: Flags::STRICT_MODE | Flags::LOG_ERRORS
);
You can also toggle flags at runtime:
$engine->enable(Flags::NO_CACHE);
$engine->disable(Flags::NO_CACHE);
Available flags
| Flag | Effect |
|---|---|
Flags::LOG_ERRORS |
Logs compilation failures via error_log(). |
Flags::STRICT_MODE |
Throws on compilation failure instead of falling back to the last cached version. |
Flags::NO_CACHE |
Always recompiles and bypasses the cache — useful during development. |
Flags::DEBUG |
Reserved; currently has no behavior. |
Engine and the template cache share the same flags, so changes made at runtime are immediately visible to both.