關于模板/插件的命名:**小寫英文字母、數字和下劃線組合,不支持駝峰寫法!**
#### **定義命名空間:**
~~~
<?php
namespace templates\index\defaults;
class Hook{
...
}
?>
~~~
即為:根目錄/templates/index/defaults/目錄下的Hook.class.php
#### **使用定義的命名空間**
~~~
<?php
use templates\index\defaults\Hook;
class test{
public function testDemo(){
$hook=new Hook();
//若存在有靜態變量或方法
$a=Hook::靜態變量名稱
$b=Hook::靜態方法名稱
}
}
?>
~~~