2009/10/02

how to use smarty plugin with multiple parameters

For example, you have a plugin function like,

function smarty_modifier_trans_seo($string,$grp="",$sbgrp="",$ln="") {}

As you see, this plugin function accepts up to 4 parameters. By default the last 3 are empty.

Usage:

1. one parameter:
{$onefoo|trans_seo}

2. two parameters:
{$firstfoo|trans_seo:$secondfoo}

3. there parameters:
{$firstfoo|trans_seo:$secondfoo:$thirdfoo}

Four parameters, I bet you know how to do it.

No comments:

Post a Comment