Statamic, Laravel, and PHP Version
- Symbols Used in This Book
1.An Antlers Primer
- 1.1Tags vs. Variables
- Core Tag Names
- 1.2Modifiers
- Modifiers and
nullValues - 1.3Comments
- 1.4Escaping Antlers Code
- 1.5Self-Closing Tags
- 1.6Variables and Custom Variables
- 1.7Data Types
- 1.8Assignment Operators
- Left Assignment
- Addition Assignment
- Subtraction Assignment
- Multiplication Assignment
- Division Assignment
- Modulus Assignment
- Truthy Assignment (Gatekeeper)
- 1.9String Concatenation
- 1.10String Concatenation Assignment
- 1.11Logical and Comparison Operators
- Equality
- Identity (Strict Equality)
- Greater Than
- Greater Than or Equal To
- Less Than
- Less Than or Equal To
- Not Equal
- Inequality (Strict not-equal)
- Spaceship
- Logical AND
- Logical OR
- Logical NOT
- Null Coalescence
- 1.12Arithmetic Operators
- Number Modifiers
- Addition
- Subtraction
- Multiplication
- Division
- Modulo
- Exponentiation
- Factorial
- 1.13Bitwise Operators
- Bitwise AND
- Bitwise OR
- Bitwise XOR
- Bitwise NOT
- Bitwise Shift Left
- Bitwise Shift Right
- 1.14Antlers Style Guide
- Hyphens in Variable Names
- Custom Variable Names
- Define Arrays Outside of Loops
- Self-Closing Tags
- Use of Semi-Colons
- Modifier Syntax
2.Working with Tags
- 2.1Tag Parameters
- Custom Tag Implementations
- Dynamic Parameter Values
- String Escape Sequences in Parameter Values
- 2.2Conditional Tag Parameters
- 2.3Tag Priority
- 2.4Tag Pairs, Single Tags, and Self-Closing Tags
- 2.5Using Tags in Conditions
- 2.6Using Modifiers on Tags
- The
pluckModifier - 2.7Assigning Tag Results to Variables
- 2.8Using Tag Results in Multiple Places
- 2.9Tag Handles and Overriding Core Behavior
3.Working with Variables
- 3.1Defining Variables
- Creating Boolean Variables
- Creating Integer Variables
- Creating Floating-Point Variables
- Creating Array Variables
- Creating Lists
- Creating Strings
- 3.2Updating and Modifying Variables
- Unary Incrementing and Decrementing Operators
- 3.3Dynamic Variables
- Using the Scope Tag
- Using Temporary Arrays
- Using Dynamic Variables
- 3.4Techniques to Determine if Variables Exist
4.Working with Modifiers
- The
explodeModifier - 4.1Modifiers and Null Values
- 4.2Applying Modifiers to Expressions and Tag Output
5.Working with Strings
- 5.1Antlers Strings
- Additional String Modifiers
- 5.2The Formatting Modifiers
- Removing Characters from the End of Strings
- Formatting Strings with camelCasing
- Removing Extra Whitespace
- Converting Newlines to HTML Break Elements
- Removing Trailing/Leading Whitespace
- Reversing Strings
- Replacing Whitespace and Uppercase Characters with Dashes
- Replacing Hyphens and Underscores with Spaces
- Lowercasing the First Character of a String
- Uppercasing the First Character of a String
- Creating Lowercase Variants of Strings
- Creating Uppercase Variants of Strings
- Inverting the Case of Strings
- Limiting String Length
- Generating URL Slugs from Strings
- Removing Whitespace from HTML
- Formatting Strings with Title Casing
- Converting Tabs to Spaces within Strings
- Converting Spaces to Tabs within Strings
- 5.3The Logical Modifiers
- Checking if a String Contains a Substring
- Checking if a String Contains All Substrings
- Checking if a String Contains Any Substring
- Checking if a String Ends with Another String
- Checking if a String Starts with Another String
- Checking if a String Contains Lowercase Characters
- Checking if a String Contains Uppercase Characters
- Checking if a String Contains Only Lowercase Characters
- Checking if a String Contains Only Uppercase Characters
- Checking if a String is Alphanumeric
- Checking if a String is Alphabetical
- Checking if a String is Numeric
- Checking if a String Contains Only Whitespace
- Checking if a String is an Email Address
- Checking if a String is Valid JSON
- 5.4The Construction Modifiers
- Transliterating Characters to ASCII
- Retrieving Characters at Specific Locations
- Inserting Characters at Specific Locations
- Converting a Comma-Separated List of Variables into an Array of Values
- Encoding HTML Entities
- Reversing HTML Encoding
- Sanitizing HTML Strings
- Removing Specific HTML Tags from Strings
- Wrapping a String in an HTML Tag
- Ensuring a String Ends with Another String
- Ensuring a String Begins with Another String
- Splitting a String Into an Array
- Wrapping Search Strings Inside mark HTML Tags
- Repeating Strings
- Converting Markdown to HTML
- Replacing Substrings
- Ensuring a String Never Begins with a Substring
- Ensuring a String Never Ends with a Substring
- Wrapping Strings in Another String
- 5.5The Extraction Modifiers
- Counting the Length of Strings
- Counting Substring Occurrences
- Generating Excerpts Based on Markers
- Retrieving the First N Characters of a String
- Retrieving the Last N Characters of a String
- Calculating Estimated Reading Time
- Retrieving Substrings from Strings
- Counting the Words in a String
- 5.6String Translation Modifiers
- Generating Plural and Singular Word Forms
- Translating Strings
- Translating Strings Based on Item Count
- 5.7Managing Ranges of Items
- 5.8Creating Custom Translation Modifiers
6.Working with Conditions
- 6.1Negated Conditions
unlessReadability- 6.2Data Driven Decisions
- Modifiers and
nullValues - Null Coalescence and Variable Fallbacks
- Dynamic Parameter Values
7.Working with Dates
- Supported Time-zones
- 7.1Specifying Time-zones
- Date Modifiers
- 7.2Formatting Dates
- 7.3Customizing Multi-Site Macro Date Formats
- 7.4Relative Date/Time Information
- 7.5Comparing Dates
- Checking if a Date is after Another Date
- Checking if a Date is the Same or After Another Date
- Checking if a Date is before Another Date
- Checking if a Date is the Same or Before Another Date
- Checking if a Date Falls within a Range of Dates
- Relative Date Comparisons
8.Arrays and Loops
- Additional Array Modifiers
- The
bool_stringModifier - 8.1Conditionally Rendering Wrapper Elements
- The
asModifier - 8.2Working with Neighboring Elements
- 8.3Accessing Array Elements by Index
- 8.4Associative Arrays and YAML Maps
- 8.5Managing Array Data Scope
- 8.6Looping Key/Value Pairs
- Passing Multiple Values to Parameters
- 8.7Accessing the First and Last Array Elements
- 8.8Accessing Arbitrary Array Ranges
- 8.9Checking for Even/Odd Indexes
- 8.10Inserting Content at Arbitrary or Random Locations
- 8.11Working with Nested Loops
- 8.12Custom Variables and Nested Loops
9.Partial Templates
- 9.1Partials and Frontmatter
- 9.2Working with Slots
- Leading/Trailing Whitespace
- Named Slot Variables
- 9.3Managing Partial Tag Pairs
- 9.4Dynamically Loading Partials
- 9.5Recursive Partials
- Maintainability of Recursive Partials
- 9.6Managing Custom Fieldsets with Partials
- Working with Fieldset Prefixes
- Fieldset Prefixes and Variable Names
10.Managing Template Structure
- 10.1Template Sections
- Declaring Sections
- 10.2Creating Sections Inside Loops
- Dynamic Section Names
- 10.3Accessing Parts of the Current Template
- 10.4Ensuring Content Renders Once
- 10.5Content Stacks
- Declaring Stacks
- 10.6Accessing Stack Contents as an Array
- Using Stacks and Yield to Manage Custom Classes
11.Intermediate Arrays and Loops
- 11.1Sorting Arrays
- Advanced Array Sorting
- 11.2Randomizing Array Elements
- Shuffling Strings
- 11.3Merging Arrays
- 11.4Chunking Arrays
- 11.5Grouping Arrays
- Aliasing Group Keys
- 11.6Filtering Arrays
- 11.7Selecting Items from Arrays
12.PHP & Antlers
- Inline PHP Best Practices
- PHP Output is Not Escaped
13.Antlers and Blade Components
- Installing Antlers Components
- 13.1Supplying Parameter Values
- Escaping
:in Parameter Names - Shorthand Variables
- Variable References
- Name/Value Parameters
- Attributes
