含有‘Smarty’关键字的文章列表

ECShop调用具体的自定义商品属性

  6条留言

      ECSHop的自定义属性很是好用,但是在前台输出的时候非常麻烦,只能循环输出所有的附加商品属性,不能输出制定的某个自定义的属性,本来它用的是Smarty模板,但是到2.5之后好像是把Smarty修改很多,里面好多东西不能用了。今天给朋友改东西,随便就写了下。

      我只在商品具体信息页面(goods.php)做了这个事情,可以的话可以写到每个页面去。

PHP&MySQL Tags: ,

Smarty技巧

  暂时没有留言

安装:
可以通过继承来实现安装的,看代码

PHP代码
  1. //setup.php   
  2. <?php   
  3. require("libs/Smarty.class.php");   
  4. class Smarty_C extends Smarty{   
  5.     function Smarty_C(){   
  6.         $this->smarty();   
  7.         $this->template_dir = 'templates';   
  8.         $this->compile_dir = 'templates_c';   
  9.         $this->cache_dir = 'cache';   
  10.         $this->left_delimiter = '<{';   
  11.         $this->right_delimiter = '}>';   
  12.         $this->caching = 1;   
  13.         $this->cache_lifetime = 1800;   
  14.         $this->config_dir = 'config';    
  15.   
  16.         //regist functions   
  17.         $this->register_block('dynamic','smarty_block_dynamic',false);   
  18.     }   
  19. }   
  20.   
  21. function smarty_block_dynamic($param$content$smarty) {   
  22.     return $content;   
  23. }   
PHP&MySQL Tags: