Block Functions

PHP Smarty

Smarty - the compiling PHP template engine
Prev 来源:PHP中文社区 Chapter 16. Extending Smarty With Plugins
利用插件扩展Smarty
Next

Block Functions块函数

<?php
/*
 * Smarty plugin
 * -------------------------------------------------------------
 * File: block.translate.php
 * Type: block
 * Name: translate
 * Purpose: translate a block of text
 * -------------------------------------------------------------
 */
function smarty_block_translate($params, $content, &$smarty)
{
 if (isset($content)) {
 $lang = $params['lang'];
 // do some intelligent translation thing here with $content
 return $translation;
 }
}

Prev 来源:PHP中文社区 Home Next
Modifiers[修正器] Up [编译函数]Compiler Functions