Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom Smarty functions

Tags:

php

smarty

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

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

is it possible ?

like image 767
Rami Dabain Avatar asked May 07 '26 13:05

Rami Dabain


1 Answers

Smarty allows you to create such custom functions easily: see the official reference.

like image 166
Piskvor left the building Avatar answered May 09 '26 03:05

Piskvor left the building