Articles & Interviews

The Twig pro­cess­ing order in Craft templates

Sometimes the order of things matters. This article begins to explore how Twig Templates in Craft CMS are processed. We'll take a look at the order in which the `set`, `block`, `extends` and `include` tags get evaluated and rendered. Understanding the logic behind how the page is processed will help you decide when to use these tags; whether you should be using these tags in your layouts, page templates, or partials; and know when you need to consider alternative methods to pass variables between your templates more easily when dealing with more advanced templating needs. Read More »

Ben Parizek

The Defin­i­tive Guide to Val­i­da­tion in Craft

In the 5 part series linked below, Stephen Lewis from Experience provides a nice overview and deep dive of Validation in Craft and how it relates to the underlying validation in Yii.

Part 1: Foundations
If you’re working on a Craft plugin that accepts user input, chances are you’ll want to validate that data...

Part 2: AttributeTypes
This instalment is all about Craft’s AttributeTypes: what they are, what they do, and which ones are available.

Part 3: Attribute Rules
This instalment is all about attribute rules: what they are, how they affect validation, and which ones are available.

Part 4: Hidden Validator Settings
This instalment is all about “hidden” validator settings, which aren’t accessible via the usual Craft attribute rules.

Part 5: Custom Validators
This instalment is all about implementing your own custom validators.

Martini Icon
Next Page

Level up in Craft CMS with practical examples, snippets, and patterns.
Craft The Planet emails are sent out several times a week.