Test Ternary Operators Test
Ternary Operator:
{$a = 1}
{$b = 1}
{$a == $b ? <span class="bold">true</span>}
Test
true
Ternary Operator
{$a = 1}
{$b = 2}
{$a==$b ? <span class="bold">{`hello world`} {$a} = {$b}</span>: <span class="bold">{`non exists const`} {$a} != {$b}</span> }
Test
non exists const 1 != 2
Test Control Structures
if
{$a = 1}
{$b = 1}
{if $a == $b}
Pizza Margherita
{/if}
Test
Pizza Margherita
else, else if
{$a = 3}
{$b = 1}
{$c = 3}
{if $a == $b}
Pizza Margherita
{else if $a == $c}
Pizza Pepperoni
{else}
You will stay hungry
{/if}
Test
Pizza Pepperoni
foreach
{$arr = [0 => "Wiener Schnitzel",1 => "Pizza Pepperoni",2 => "Pizza Margherita",3 => "Waffle","Ice cream"]}
<ol>
{foreach $arr as $key => $value}
<li>{$key} - {$value}</li>
{/foreach}
</ol>
Test
- 0 - Wiener Schnitzel
- 1 - Pizza Pepperoni
- 2 - Pizza Margherita
- 3 - Waffle
- 4 - Ice cream
Test Include & Import
include
{calc}
{$a += $a}
{/calc}
{test}
{$a = 1}
include{calc}
{$a}
{/test}
Test
Result: 1
import
{calc}
{$a += $a}
{/calc}
{test}
{$a = 1}
import{calc}
{$a}
{/test}
Test
Result: 2
Test Adding Resources to Templates
{$domain}{Version|assets/css/style.css}
Test
https://aurora.netlife.guru/assets/css/style.css?v=1715283425
- Installation - Installing Aurora Template
- Usage - Basic Usage of the PHP NLG Template Engine
- Storage-Setting Directories for Templates and Cache
- Templates - Setting Up Input Templates
- Variables - Setting Variables in the System
- Language Constants- Setting Language Constants
- Cache - Managing Cache Creation
- Router - Standalone Mode with Routing System
- Using the PHP Template Engine
- Blocks - Block Based template engine
- Using variables - How to use variables in templates
- Calculations - Isolation and Sharing Variables
- Include and Import - include vs. import in the Template Engine
- Import - Leveraging `import{}` for Standalone Applications with a Routing System
- Resources - Adding Resources to Templates
- Control Structures - `if`, `else if`, `else`
- Ternary Operator - How to approach to ternary operator
- Macros - Macros in Template Engines - Understanding the Concept
- Custom Macros - Creating Custom Macros in Template Engines
- Forms - Creating Forms in the Template Engine
- Custom forms - Customizing Forms in the Template Engine
- Custom PHP Forms - PHP Developer's Guide to Customizing Form Templates in the Template Engine
- Curly Brackets - Handling Curly Brackets in Text Content
- Error Handling - Error Handling in PHP Template Engine
- Tests