php+代码模板下载地址,简单而强大的PHP模板引擎

Simple and Powerful Template Engine for PHP.

Version 0.2

code

```php

include( 'forkTemplate.php' );

// まず、タグファイル(snippet)の場所と拡張子をセット

// first , set where tag files (snippet) are, and there extension.

$f = new forkTemplate( dirname( FILE ) . "/tags" , "tag" );

// そして、次にターゲットを決めます。これはメインテンプレートに、{@body}のように表記します。

// second , set target , which is written in main template file, like "{@body}"

$f->target( "body" );

// pタグで括るスニペットを使って、文字列をpタグで括ってみます。そしてテンプレートファイルのターゲットに差し込みます。

// wrap strings with

, using p.tag ( snippet file with

) and throw into target in main template.

$f->tag( 'p' )->val( "this is test");

// そして、レンダリングします。

// and then , render.

echo $f->render( " this is main template , and {@body} " );

// 入れ子もできます。

// you can nest tags ,

$f->tag( 'div' )->tag( 'p' )->v

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值