TeAmEr
TeAmEr

Reputation: 4773

Custom Smarty functions

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 ?

Upvotes: 3

Views: 6168

Answers (1)

Piskvor left the building
Piskvor left the building

Reputation: 92762

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

Upvotes: 4

Related Questions