Templating Language
Create dynamic templates with BoxLang's powerful templating language for HTML generation, views, and content rendering
π Template File Structure
<!DOCTYPE html>
<html>
<head>
<title>Welcome to BoxLang</title>
</head>
<body>
<bx:output>
<h1>Hello, #name#!</h1>
<p>Today is #dateFormat( now(), "full" )#</p>
</bx:output>
</body>
</html>π€ Output Interpolation
Basic Interpolation
Escaping Hash Symbols
Complex Expressions
π·οΈ Template Components
Common Template Components
bx:output
bx:set
bx:script
bx:if, bx:elseif, bx:else
bx:loop
bx:include
Additional Template Components
bx:param
bx:try / bx:catch / bx:finally
bx:throw
bx:abort
bx:dump
bx:exit
bx:savecontent
bx:silent
π Mixing Scripts and Templates
Scripts in Templates
Templates in Scripts
π― Component Execution
Built-in Components
Custom Components
Creating a Custom Component
Using Custom Components
Component Discovery
Configuring Component Paths
π‘ Practical Examples
Dynamic HTML Page
Data Table with Query
Email Template
Form Processing
π Security Considerations
π Component Reference
π Best Practices
π Related Documentation
Last updated
Was this helpful?

