布局文件:

<div>我是头部</div>
<!--展示首页、登录、注冊等代码信息-->
<!--$content代表我们已经提取出来的首页、登录、注冊等页面信息(没有头部和脚部)-->
<? php echo $content; ?> <div>我是尾部</div>

位置:

watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvYnV5aW5nZmVpODg4OA==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="">

布局文件已经实现出来,以下我们须要使用这个布局文件

我们系统默认的布局文件是colum1.php

使用布局文件:

布局文件详细与什么有关系:

控制器渲染视图renderPartial()此方法不会渲染布局

render()这种方法会渲染布局。

如今我们布局已经做好了:

1. 制作布局文件layouts/文件名称字,使用$content代表普遍模板内容。

2. 设置布局文件,在父类控制器里边public $layout = "//layouts/shop";

3. 调用布局文件,在控制器方法里边用法render()就会调用布局文件。

还有一种通过frameset来实现:

<!--通过html的frameset标签集合头部、左側、右側-->
<!doctype html public "-//w3c//dtd xhtml 1.0 frameset//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-frameset.dtd">
<html>
<head>
<meta http-equiv=content-type content="text/html; charset=utf-8" />
<meta http-equiv=pragma content=no-cache />
<meta http-equiv=cache-control content=no-cache />
<meta http-equiv=expires content=-1000 /> <title>管理中心 v1.0</title>
</head>
<frameset border=0 framespacing=0 rows="60, *" frameborder=0>
<frame name="head" src="./index.php?r=houtai/index/head" frameborder=0 noresize scrolling=no>
<frameset cols="170, *">
<frame name="left" src="./index.php?r=houtai/index/left" frameborder=0 noresize />
<frame name="right" src="./index.php?r=houtai/index/right" frameborder=0 noresize scrolling=yes />
</frameset>
</frameset>
<noframes>
</noframes>
</html>

最新文章

  1. iOS让键盘消失,取消第一响应,取消一级响应
  2. sqlserver 存储过程 以及统计整个数据库数据
  3. Eclipse中Maven的安装
  4. .NET String.Format 方法 线程安全问题
  5. 【Android UI】色板
  6. Emmet之html语法
  7. ASP.NET MVC WebAPI Put和Delete请求出现405(Method not allowed)错误
  8. php7之严格模式RFC
  9. SSM基础整合
  10. vs2015 停 在 update kb2999226 一直不动
  11. sqlserver查询数据表中每个类别最新的一条记录
  12. PHP里echo print print_r的区别
  13. 在Chrome浏览器中保存的密码有多安全?
  14. NOIP2018 Day2毒瘤题目
  15. Discrete cosine transform(离散余弦转换)
  16. 【重点突破】—— Vue2.0 transition 动画Demo实践填坑
  17. 小图拼接大图MATLAB实现
  18. javascript基础工具清单
  19. 【Codeforces】Gym 101156G Non-Attacking Queens 打表
  20. springboot+shiro+cas实现单点登录之shiro端搭建

热门文章

  1. ubuntu安装Java jdk1.7.0
  2. log4net使用经验总结
  3. 基于visual Studio2013解决C语言竞赛题之1048打印矩阵
  4. Andorid时间控件和日期控件
  5. Google 开源项目风格指南阅读笔记(C++版)
  6. 1.1.0-学习Opencv与MFC混合编程之---全屏截图,保存为BMP图像(并增加快捷键)
  7. Round Numbers
  8. Kendo UI开发教程(25): 单页面应用(三) View
  9. vim 操作指令2
  10. 如何将excel文件中的数百万条数据在1分钟内导入数据库?