resopollution
resopollution

Reputation: 20350

Is there a way to use PHP code inside a smarty template?

I searched google, but coulding find anything. Checked the documentation too...

I thought Smarty allowed PHP to be written inside the template itself if you escaped the template engine?

Upvotes: 0

Views: 3752

Answers (3)

rekarnar
rekarnar

Reputation: 463

Note: As of Smarty 3.1 the {php} tags are only available from SmartyBC.

Source: http://www.smarty.net/docs/en/bc.tpl

Upvotes: 1

SkaveRat
SkaveRat

Reputation: 2282

you can also use

include_php

if you really have to. But It's not the best solution (the function is pretty much deprecated)

Upvotes: 0

mercutio
mercutio

Reputation: 22597

There is the ability to write PHP code inside {php} tags, but you have to turn this on with a smarty config setting.

Smarty PHP Tag

Upvotes: 3

Related Questions