* [ ] 模板語法對照 (JS CSS中也可以使用,配置文件中設置`@`,則使用`{@$user}`)
* [ ] `:`或者`.`開頭不使用echo
* [ ] `$$`開頭對像變量 (`{$$Obj}`解析成`$this->Obj`)
* [ ] `$.`開頭局部變量(`{$.Obj}`解析成`$Obj`)
* [ ] `$`開頭模板變量 (`{$Obj}`解析成`$this->obtain('Obj')`)
```
{file='foot.php'} {file=foot.php} {file="foot.php"} {file="foot"} {file=foot} //引入其他模板,這些寫法都可以
{$user='administrator'} <?php $this->assign('user','administrator');?>//設置參數
{:dump($user)} <?php dump($this->obtain('user'));?>//使用dump方法,前面加點號代表不使用echo
{dump($user,false)} <?php echo dump($this->obtain('user'),false);?>//使用dump方法,前面不加點號代表使用echo
{$inttest=2*8+9} <?php $this->assign('inttest',2*8+9);?>//可以這樣使用
{$inttest} <?php echo $this->obtain('inttest');?>//輸出25
{$$Data='demo'} <?php $this->Data='demo';?>//2個$$代表使用$this
{$$Data} <?php echo $this->Data;?> //前面不加點號代表使用echo
{.$$Data} <?php $this->Data;?> //前面加點號代表不使用echo
{:$$getuserid()} <?php $this->getuserid();?>//2個$$代表使用$this,前面加點號代表不使用echo
{$.userid=$$getuserid()} <?php $userid=$this->getuserid();?> //調用方法
{$a.b.c='數組使用'} <?php $this->assign('a.b.c','數組使用');?>//設置數組
{$a.b.c} <?php echo $this->obtain('a.b.c');?>//輸出:數組使用
{$.demo='abcd'} <?php $demo='abcd';?>//使用$.開頭設置變量
{$.demo} <?php echo $demo;?>//輸出變量
{:test($.a,$$b,$c)} <?php test($a,$this->b,$this->obtain('c'));?>//調用方法,前面不要.就echo
{$info=test($.a,$$b,$c)} <?php $this->assign('info',test($a,$this->b,$this->obtain('c')));?>//也可以這樣
{$.home->aaa(1,2,$hh)} <?php echo $home->aaa(1,2,$this->obtain('hh'));?>//比如home是對像的
{.$.home->aaa(1,2,$hh)} <?php $home->aaa(1,2,$this->obtain('hh'));?>//比如home是對像的
{$self=new Session()} <?php $this->assign('self',new Session());?>//可以New類
{$info=$self->get()} <?php $this->assign('info',$this->obtain('self')->get());?>//調用類方法
{.ps($info)} <?php ps($this->obtain('info'));?>//輸出
{.Cookie::set('test','123456',3600)} <?php Cookie::set('test','123456',3600);?>//使用Cookie設置
{$.get=Cookie::get()} <?php $get=Cookie::get();?>
{.ps($.get)} <?php ps($get);?>//輸出Cookie
{.ps(Cookie::get())} <?php ps(Cookie::get());?>//輸出Cookie (優化模板后支持寫法)
{/*注析/} <?php /**注析*/?>
{//注析} <?php //注析?>
```
* [ ] function
```
{function test($id) }
{/function}
{function demo($id) use($config)}
{/function}
<?php function test($id) {?>
<?php }?>
<?php function demo($id) use($config){?>
<?php }?>
```
* [ ] if elseif
```
{if ($a==2 && $.b!='s' || $$Data->name=='admin')}
{elseif ($a==3 && $.b=='s' || $$Data->name!='admin')}
{/else} //寫法2{else}
{/if} //寫法2{if}
<?php if ($this->obtain('a')==2 && $b!='s' || $this->Data->name=='admin'){?>
<?php }elseif ($this->obtain('a')==3 && $b=='s' || $this->Data->name!='admin'){?>
<?php }else{?>
<?php }?>
```
* [ ] foreach
```
//{foreach arr k v} 可以不要$ 默認$
{foreach $arr $k=>$v} //寫法2{foreach $arr $k $v} 寫法3 {foreach $arr=$k=$v} //同樣可以使用$. $$
{.ps($k)}
{.ps($v)}
{/foreach} //寫法2{foreach}
<?php foreach($this->obtain('arr') as $this->TplData['k']=>$this->TplData['v']){?>
<?php ps($this->obtain('k'));?>
<?php ps($this->obtain('v'));?>
<?php }?>
{foreach $arr $v} //寫法同上
{.ps($v)}
{/foreach}
<?php foreach($this->obtain('arr') as $this->TplData['v']){?>
<?php ps($this->obtain('v'));?>
<?php }?>
```
* [ ] for
```
{for $i=0; $i<=10; $i++} //同樣可以使用$. $$
{$i}
{/for}//寫法2{for}
<?php for($this->TplData['i']=0; $this->TplData['i']<=10; $this->TplData['i']++){?>
<?php echo $this->obtain('i');?>
<?php }?>
```
* [ ] switch
```
//同樣可以使用$. $$
{switch:$aaa}
{case:111}
1
{.break}
{case:"ok"}
2
{case:$a}
3
{.break}
{default:}
4
{.break}
{/switch}
<?php switch ($this->obtain('aaa')){?>
<?php case 111:?>
1
<?php break;?>
<?php case "ok":?>
2
<?php case $this->obtain('a'):?>
3
<?php break;?>
<?php default:?>
4
<?php break;?>
<?php }?>
```
- 開始使用
- 配置文件
- 路由模式
- AutoLoad類
- 啟動文件
- __construct
- SetRouting
- SetAlias
- SetStop
- SetError
- Access
- SetWorker
- SetClassFile
- SetClassDir
- Run
- OpenLoad
- LinuxStartAll
- Session類
- 使用說明
- set
- get
- delete
- pull
- has
- id
- Cookie類
- 使用說明
- set
- get
- delete
- pull
- has
- TempLets類
- 模板語法
- 模板標簽
- html
- show
- assign
- obtain
- Request類
- get
- post
- host
- referer
- getip
- localip
- header
- body
- file
- scheme
- protocolversion
- uri
- path
- querystring
- method
- Response
- SendFile
- FileStream
- SendData
- SetStatus
- SetHead
- SetMime
- WebSend
- redirect
- dumpJson
- dump
- come
- ps
- Frame類
- GetWeb
- ViewFile
- RoutingData
- SetClassFile
- SetClassDir
- GetMime
- FileMime
- LoadDir
- StartDir
- IsJson
- ArrJson
- JsonFormat
- ObStart
- GetConfig
- ConfigDir
- TempDir
- GetRunData
- GetStatic
- IsDebug
- SetDebug
- GetDebugInfo
- GlobalVariables類
- 使用說明
- set
- get
- delete
- pull
- has
- id
- Mysql類
- 新版本
- 第三方
- Thinkorm
- Medoo
- 舊版本
- Mysql 配置格式
- 項目中操作數據庫
- 項目場景
- 項目數據庫配置
- 項目數據庫中間類
- 項目中操作數據表
- 連貫操作
- where
- table
- data
- order
- field
- limit
- page
- group
- having
- join
- tabname
- union
- sql
- link
- link_base
- lock
- CURD 操作
- 寫入數據
- 數據刪除
- 數據查詢
- 數據更新
- 數據統計操作
- count
- sum
- max
- min
- avg
- 操作DEMO
- CurdTrait.php
- 項目Model層操作表.md
- Curl類
- Method類
- SslAes類
- layui_zqadmin