助力软件开发企业降本增效 PHP / java源码系统,只需一次付费,代码终身使用! 广告
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.