Zing. compile-to-PHP template engine GitHub ↗

Built-in Directives

Directive Closes with Notes
@if / @elseif / @else @endif
@unless @endunless inverse of @if
@isset @endisset
@empty @endempty
@once @endonce renders at most once per render() call
@foreach @endforeach
@for @endfor
@while @endwhile
@switch / @case / @default @endswitch pair @case with @break
@break / @continue — optional condition argument
@php @endphp raw PHP passthrough
@include — renders another template
@extends — declares a parent template
@section @endsection captures a block for the parent
@yield — outputs a captured section
@class / @style — conditional attributes
@checked / @selected / @disabled / @readonly / @required — boolean HTML attributes
@attributes — spreads an associative array as attributes
@verbatim @endverbatim renders content literally, no Zing parsing