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 foreach loop.
Learn more

Include

@include

No

Include tag is used to include a partial instead of writing inline HTML.
Learn more.

Component

@component

Yes

Let you make use of a self-contained component.
Learn more.

If

@if

Yes

Let you define conditional blocks inside your templates.
Learn more.

Unless

@unless

Yes

Let you define a conditional block, which is opposite to @if tag.
Learn more.

Layout

@layout

No

Let you define a layout for a template.
Learn more.

Yield

@yield

Yes

Output a variable if it exists, otherwise, show default content.
Learn more.

Section

@section

Yes

Define/Override content for a given section.
Learn more.

Debugger

@debugger

No

Add debugging break point.
Learn more.

Writing Your Own Tags

Check out the following videos in order to learn to create your own tags.