# 公共參數
* [ ] `標簽介紹` include,在當前模版文件中包含其他的模版文件使用include標簽。
* [ ] `使用范圍`:全局。
*****
### 溫馨提示:
包含的模板文件中不能再使用模板布局或者模板繼承。
>調用示例
~~~
//通常情況下加載公用列表模板
{include file="common/item_news"}
~~~
可以一次包含多個模版。例如:
~~~
{include file="public/header,public/menu" /}
~~~
可以直接包含一個模版文件名(包含完整路徑),例如:
~~~
{include file="../application/view/default/public/header.html" /}
~~~
### 傳入參數
無論你使用什么方式包含外部模板,Include標簽支持在包含文件的同時傳入參數,例如,下面的例子我們在包含header模板的時候傳入了`title`和`keywords`參數:
~~~
{include file="Public/header" title="$title" keywords="開源WEB開發框架" /}
~~~
就可以在包含的header.html文件里面使用title和keywords變量,如下:
~~~
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>[title]</title>
<meta name="keywords" content="[keywords]" />
</head>
~~~
上面title參數傳入的是個變量$title,模板內的\[title\]最終會替換成$title的值,當然$title這個變量必須要存在。
**包含文件中可以再使用include標簽包含別的文件,但注意不要形成A包含A,或者A包含B而B又包含A這樣的死循環。**
- 介紹
- 標簽手冊
- 全局標簽
- block標簽
- config標簽
- execute標簽
- query標簽
- breadcrumb標簽
- blocklist標簽
- 欄目標簽
- channellist標簽
- channel標簽
- nav標簽
- 文章標簽
- arclist標簽
- archives標簽
- prevnext標簽
- 專題
- speciallist標簽
- special標簽
- 公共參數
- common參數
- include引用
- 單頁
- spagelist標簽
- page標簽
- spageinfo標簽
- 特殊標簽
- tagslist標簽
- tags標簽
- commentlist標簽
- commentinfo標簽
- diyform標簽
- 模板特殊標簽
- 列表頁面
- pagelist標簽
- pageinfo標簽
- pagefilter標簽
- pageorder標簽
- pagelist的相關排序
- 新功能
- 后端新增代碼
- 模板使用
- 二級導航功能
- 共用banner功能
- 后臺站點配置添加編輯器