Custom Smarty Features

In Smarty, I want to be able to write {widget 15} or {widget id = 15}, so the output will be the return value of the PHP function

function widget($id){
    echo 'hi '.$id;
}

Is it possible?

+3
source share
1 answer

Smarty makes it easy to create these custom functions: see the official link .

+4
source

Source: https://habr.com/ru/post/1777652/


All Articles