-
Notifications
You must be signed in to change notification settings - Fork 582
Working with the templating system
First thing which is really important: it's all just Perl! You can use Perl in your templates where ever you like! There are several options for the developer to render its content. Here is a simple rule: if you need output for the outside of an application stick it to the view. Don't use print to generate html output. The templating system which is being used by Mojolicious is Embedded Perl.
Actually it's just Perl syntax with some special things to take care about. If Perl code is being used inside the template it has to been prefixed with a '%' sign. If you want to print the value of a variable the signs <%= $variable %> are being used. There is a difference between <%== $variable %> and <% $variable %>. Make sure to read the documentation about different templating tags, this will save you plenty of debugging efforts.