un-well-known(?) usage of Smarty modifier (4)

Date 2006-07-12 05:03:13 | Category: XOOPS

in englishin japanese
You can use not only php's built-in functions but also functions defined by user.

But you have to know the function should be both ...
A) defined on smarty compiling
B) defined on smarty rendering

At least, functions defined in include/functions.php can be used.

eg) you can use xoops_substr() like this.

<{$news.title|xoops_substr:"0":"20"}>


Though Smarty's default plugin of "truncate" is not compatible for multibyte, xoops_substr() is compatible.

You will be a little closer to "gread customizer" with this tips




You can read more news at PEAK XOOPS.
http://xoops.peak.ne.jp

The URL for this story is:
http://xoops.peak.ne.jp/md/news/index.php?page=article&storyid=135