1. PHP include 語句
`{include file="xxx/xxxxxxx" /}`
include (或 require)語句會獲取指定文件中存在的所有文本/代碼/標記,并復制到使用 include 語句的文件中。
包含文件很有用,如果需要在網站的多張頁面上引用相同的 PHP、HTML 或文本的話。
如:cms左側的導航、多圖、評論都用到了PHP include 語句。
`{include file="content/left" /}`
`{include file="index@common/field" /}`
`{include file="content/comment_pc" /}`
也可以在的模板目錄下,對應的模塊目錄下的 content 文件夾下,新建一個文件如:123.htm 在里面寫好要顯示的內容。
在相應的模板位置加入`{include file="content/123" /}`
2. 加起來一起統計
*`<script type="text/javascript">
`
*` var a ={:query('cms_content',['count'=>'id'])};
`
*` var b ={:query('shop_content',['count'=>'id'])};
`
*` document.write(a+b);
`
*`</script>`
3. 404頁面
`application/common/behavior/Init.php
`
`showerr('當前頻道不存在!');
`
`在他上面加上
`
`header("location:".request()->domain()); exit;`
4.