Tags
Tags are the backbone of Edge templates. They let you define the behaviour of your templates. Edge itself does not add any logic to your templates but exposes any API to be used for creating powerful and expressive tags.
Available Tags
Below is the list of in-built Edge tags, however you are free to add your own.
Tag |
Used As |
Block Level |
Description |
Each |
@each |
Yes |
Each tag let you iterate over Arrays and Objects, just like a |
Include |
@include |
No |
Include tag is used to include a partial instead of writing inline HTML.
|
Component |
@component |
Yes |
Let you make use of a self-contained component.
|
If |
@if |
Yes |
Let you define conditional blocks inside your templates.
|
Unless |
@unless |
Yes |
Let you define a conditional block, which is opposite to |
Layout |
@layout |
No |
Let you define a layout for a template.
|
Yield |
@yield |
Yes |
Output a variable if it exists, otherwise, show default content.
|
Section |
@section |
Yes |
Define/Override content for a given section.
|
Debugger |
@debugger |
No |
Add debugging break point.
|
Writing Your Own Tags
Check out the following videos in order to learn to create your own tags.