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?
