mranchovy/smarty3 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mranchovy/smarty3

Composer 安装命令:

composer require mranchovy/smarty3

包简介

Integration of Smarty v3 with the Kohana PHP Framework

README 文档

README

This is a module for the Kohana PHP framework that integrates the Smarty Template Engine.

Documentation and support for this module can be found on Github. Note this version is compatible with Kohana 3.3. For Kohana 3.0-3.2 you want the 1.x branch.

Version 2.0.3-dev

Quick Start

  • Download and unpack the module
  • Put the smarty3 module in your modules directory
  • Enable the smarty3 module in your bootstrap file
  • To use Smarty for a view you need to create a Smarty template template_name.tpl in your application's views directory. Then when you do $view = View::factory('template_name.tpl') you can use the $view object just as you would with a regular PHP view.
  • That's all there is to it! There's only one hitch, you can't use $view = new View('template_name.tpl') or change the template of an existing PHP view object to a Smarty template with $view->set_filename().
  • If your controller extends the Controller_Template class, you can use a Smarty template for your page layout too - just set public $template = 'layout_template_name.tpl'; in your controller class.

Upgrading from earlier Version 2 releases

  • Download and unpack the module
  • Replace the existing smarty3 module with the new version
  • Delete compiled templates (in APPPATH/cache/smarty_compiled by default)

Upgrading from older versions

Upgrading from older versions should work as above.

How does this magic work?

The Smarty module creates a View class that extends Kohana_View to intercept the View::factory() method and return an instance of either the unmodified Kohana_View for a PHP template or an instance of Smarty_View if the view file has the .tpl extension. Smarty_View implements the methods of Kohana_View to act on a Smarty object. If you are converting existing code, or just prefer to use the Smarty object directly, you can access it with $view->smarty(), but note that not all of the available methods have been tested and may produce unpredicatable effects.

More information

Documentation and support for this module can be found on Github. Support for Smarty and its standard plugins is of course on the Smarty site.

Copyright

Licence

This distribution of the Smarty3 Module for Kohana is released under the Kohana License

The distribution of Smarty included in this package is released under the GNU Lesser General Public License (LGPL) - see the Smarty documentation for more details.

统计信息

  • 总下载量: 35
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 25
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 25
  • Watchers: 7
  • Forks: 13
  • 开发语言: PHP

其他信息

  • 授权协议: Kohana
  • 更新时间: 2014-04-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固