Skip to content

Meet PowerParser#

PowerParser is a strong, regex-based and excellent templating engine which will make your work and code less. PowerParser is included with Invention Framework, so you don't need to worry about that.

PowerParser supports a bunch of directives that can make your code elegant and less. If you're familier with Laravel Framework, then you should probably know about Laravel's Blade Directives, and PowerParser supports almost every directive of Blade!

For example, an if statement in Blade:

@if(condition)
<!--HTML-->
@endif

But in PowerParser, you need to just replace the @ with a :

:if(condition)
<!--HTML-->
:endif

Outputting something:

{{ "text" }}
{{ $variable }}
{{ func() }}

PowerParser will call htmlspecialchars() and filter strings every time when you output something in this way.

Also you might need a single line PHP code which should not be outputted, for that use this:

!{{ "Text" }}! <!--Nothing is outputted-->
!{{ $variable++ }}! <!--Increments $variable by 1-->
!{{ $var = func() }}! <!--Calls func() and assigns the return value to $var--->
Back to top