smarty-view-renderer

 
 
******************安装使用说明******************
 
1. 将压缩包解压内容至\protected\extensions\smarty\文件夹下
2. 需要在config/main.php的components中配置以下组件信息:
 
            //smarty-view-renderer 扩展组件
            'viewRenderer'=>array(
                'class'=>'application.extensions.smarty.ESmartyViewRenderer',
                'fileExtension' => '.tpl',
            ),
 
======================================
在Controller使用时调用方法:

Posted 31 October 2010 - 09:00 AM

You should do it the same way as with native Yii templates:

classMyControllerextendsCController{
  function actionIndex(){
    $this->render('index', array(
      'variable'=>'value'
    ));
  }
}
 
 
======================================

Installation,官方安装说明

  • Extract the release file under vendor/Smarty.
  • Download and extract libs folder contents of Smarty package under protected/vendor/Smarty.
  • Move files from plugins folder to protected/vendor/Smarty/plugins.
  • Add the following to your config file 'components' section:
<?php
// ...
'viewRenderer'=>array(
'class'=>'application.ventor.Smarty.ESmartyViewRenderer',
'fileExtension' => '.tpl',
//'pluginsDir' => 'application.smartyPlugins',
//'configDir' => 'application.smartyConfig',
//'prefilters' => array(array('MyClass','filterMethod')),
//'postfilters' => array(),
//'config'=>array(
// 'force_compile' => YII_DEBUG,
// ... any Smarty object parameter
//)
),

There are some more options on configuring Smarty properties now. Will add documentation soon.

YII安装smarty-view-renderer扩展的更多相关文章

  1. Yii 安装二维码扩展Qrcode

    比如要添加 https://github.com/2amigos/yii2-qrcode-helper 生成二维码的 这个扩展第一种方法 :    1.打开根目录的composer.json, 在re ...

  2. yii安装redis扩展(Windows)

    yii安装redis扩展可以用不同的方式, 最简单便捷的是使用 composer 方式, 有的时候composer会出现一些问题(现在还弄不懂),可能是网络什么的原因吧~ 还可以使用手动安装的方式, ...

  3. Win7下安装composer, 并使用其安装smarty

    安装composer需要开启PHP openssl扩展. 1) 先查看PHP是否开启了openssl扩展 键盘win+r 输出cmd, 可以看到Dos窗口, 然后执行php -m (需要添加PHP环境 ...

  4. centos yum 安装 mongodb 以及php扩展

    centos yum 安装 mongodb 以及php扩展 投稿:hebedich 字体:[增加 减小] 类型:转载 MongoDB是一个基于分布式文件存储的数据库.由C++语言编写.旨在为WEB应用 ...

  5. centos'的yum安装php的memcache扩展

    centos'的yum安装php的memcache扩展 博客分类: linux   让php能使用memcached服务的扩展有两种:memcache 和 memcached 1. 先安装libmem ...

  6. centos安装redis及php-redis扩展

    centos安装redis及php-redis扩展  Linux, WEB 七162012 今天公司同事要求在测试机上安装redis,并且要求让php安装上redis的扩展,redis是一个key-v ...

  7. windows下AppServ安装php的memcached扩展

    memcache和memcached的区别  在自己的新程序中打算全面应用memcached技术,这个很容易理解这是memcached是内存缓存,但是怎么还有memcache呢?  其实很简单,mem ...

  8. Yii集成smarty说明

    1.       [在protected目录下建立文件夹vendor/smarty,把smarty的类包放入其中] 2.       [在extensions目录下边建立文件CSmarty.php] ...

  9. pecl安装php的ev扩展时的报错处理

    pecl安装php的ev扩展,安装完毕后php.ini中加入扩展extension=ev.so,然后重启php-fpm出现以下报错 PHP Warning:  PHP Startup: Unable ...

  10. Linux下PHP安装配置MongoDB数据库连接扩展

    Web服务器: IP地址:192.168.21.127 PHP安装路径:/usr/local/php 实现目的: 安装PHP的MongoDB数据库扩展,通过PHP程序连接MongoDB数据库 具体操作 ...

随机推荐

  1. mini2440移植uboot-2008.10 遇到的问题

    1.mkimage的使用(u-boot-2008.10/tools/mkimage) 首先./mkimage 运行或者 将mkimage 拷贝到 /bin 目录下面 法一: #mkimage -n ' ...

  2. js生成随机字符串或者随机数

    //返回一个指定范围内的随机数 function createRandomNum(Min,Max){ let Range = Max - Min; let Rand = Math.random(); ...

  3. Gitlab服务器搭建(For fedora23)

    1. Install and configure the necessary dependencies sudo yum install curl policycoreutils openssh-se ...

  4. php tpl 模板页面如和给js文件传参数

    有一个参数,服务器传给了php 模板页面,但模板包含的js需要得到这个参数值.如何处理: 一,在引入页面前加一句代码 <script type="text/javascript&quo ...

  5. delete删除多表

    1.DELETE a.*, aa.* FROM student a, person aa WHERE a.id = aa.city_id AND a.name = '' 2.DELETE a.*, a ...

  6. KEIL4.12中添加ULINK2的支持

    转载自:http://www.amobbs.com/thread-4767650-1-1.html 如果你用KEIL4.12,但却没有Ulink2下载器,只有早先用的Ulink下载器,那么你按照下面三 ...

  7. 【面试】蘑菇街产品运营二面&结果

    2015-08-25 今天下午大概三点半接到了杭州的电话,是蘑菇街的面试官,面试官一开始就说我们简单做个15分钟的面试吧.首先,让我做一个与产品经历相关的自我介绍,我说了自己的产品实习和两个产品比赛经 ...

  8. QWidget与HWND的互相转换

    QWidget与HWND的互相转换 在编写Windows的应用程序时,我们有时不可避免地要与Windows平台固有的Win32 API打交道,但是Win32 API里面常常用到的HWND等诸多句柄QT ...

  9. SectionIndexer中的getSectionForPosition()与getPositionForSection()

    大家在做字母索引的时候常常会用到SectionIndexer这个类,里面有2个重要的方法 1.   getSectionForPosition()通过该项的位置,获得所在分类组的索引号 2. getP ...

  10. android studio 偶记

    修改项目名称 如果仅仅改了文件夹的名字,则会出现引用问题,相应的如下文件都要做相应的修改: 1. package name 要做相应调整 2. settings.gradle ,中要修改相应的moda ...