phore / template
Inject variables into a template
dev-main
2024-04-19 09:32 UTC
Requires
- php: >=8.1
- phore/filesystem: *
Requires (Dev)
This package is auto-updated.
Last update: 2024-12-19 10:53:24 UTC
README
Usage
Template Syntax
ifdef
- If the variable is definedifndef
- If the variable is not definedfor
- Loop through the list
# Normal Variable substitution
Hello {{ name }}!
{% ifdef city %}
Your city is {{ city }}.
{% endif %}
{% ifndef city %}
Your city is {{ city }}.
{% endif %}
{% for cityList as city %}
{{ city }}
{% endfor %}
# This is a comment! It will not be included to the output.
{{ name | uppercase }}
{{ dateList | each | uppercase }}
# Example on how to use filter with arguments
{{ curdate | dateFormat format="YYYY-MM-DD" }}