nojimage/cakephp-taltal 问题修复 & 功能扩展

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

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

nojimage/cakephp-taltal

最新稳定版本:2.1.1

Composer 安装命令:

composer require nojimage/cakephp-taltal

包简介

CakePHP TALTAL – PHPTAL View plugin. This plugin provides PHPTAL View Class

README 文档

README

PHP 5.3+, CakePHP 2.1+

This plugin provides PHPTAL View Class

Copyright 2013, php-tips.com (http://php-tips.com)

Plugin Installation

git submodule add -f https://github.com/nojimage/CakePHP-TALTAL.git plugins/Taltal

and get PHPTAL library.

cd plugins/Taltal
git submodule update --init

Usage

in app/Config/bootstrap.php


CakePlugin::load('Taltal');

or


CakePlugin::loadAll();

in AppController


class AppController extends Controller {
    // ...(snip)
    public $viewClass = 'Taltal.Phptal';
    // ...(snip)
}

set vars in controller action.


class PostsController extends AppController {
    function index() {
        $people = array(
            array('name' => 'foo', 'phone' => '01-344-121-021'),
            array('name' => 'bar', 'phone' => '05-999-165-541'),
            array('name' => 'baz', 'phone' => '01-389-321-024'),
            array('name' => 'quz', 'phone' => '05-321-378-654'),
        );
        $this->set(compact('people'));
    }
}

and create view file, extension is .html or .xhtml or .zpt

eg. app/View/Posts/index.html


<table>
    <thead>
        <tr>
            <th>Name</th>
            <th>Phone</th>
        </tr>
    </thead>
    <tbody>
        <tr tal:repeat="person people">
            <td tal:content="person/name">person's name</td>
            <td tal:content="person/phone">person's phone</td>
        </tr>
        <tr tal:replace="">
            <td>sample name</td>
            <td>sample phone</td>
        </tr>
        <tr tal:replace="">
            <td>sample name</td>
            <td>sample phone</td>
        </tr>
    </tbody>
</table>

LICENSE

http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License

Thanks

Support for CakePHP2.0. Thanks!: Juracy Filho https://github.com/juracy
PHPTAL :: Template Attribute Language for PHP 5
Using PHPTAL for templates: PhptalView class | The Bakery, Everything CakePHP

统计信息

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

GitHub 信息

  • Stars: 21
  • Watchers: 1
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: LGPL-3.0
  • 更新时间: 2013-02-10