Jump to content

Define variable php inside a template


Subzero-mb

Recommended Posts

I am making some modifications in templates but the most easy thing I cannot do it. I can use php inside {{ }}, conditionals, functions whatever, but when I try to define a variable I received an error.

It is very easy to test, just open in the ACP one template and include this code:

{{ $var = 'test'; }}

And when you tried to save it the ACP will tell you "This theme file cannot be saved". I have tried the test in many templates and it is always the same, even using other options:

{ $var = 'test' }  {{$var = array();}}

But for the rest of php code as conditional and internal functions of php there is no problem. What am I doing wrong? Thank you

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...