用户
 找回密码
 入住 CI 中国社区
搜索
查看: 2879|回复: 1
收起左侧

[HELP] 有用过smarty扩展函数的吗

[复制链接]
发表于 2009-8-6 16:47:06 | 显示全部楼层 |阅读模式
有用过smarty扩展函数的吗?麻烦发个例子给我看看。谢谢啦
发表于 2009-8-7 18:52:35 | 显示全部楼层
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
function smarty_function_product($params, &$smarty){
       
        $id = (int)$params['id'];
       
        $CI= &get_instance();                       
       
        $CI->load->model('product');
       
        if($id){
                       
                return $CI->product->get_products_by_id($id);
       
        }
}
?>

本版积分规则