首页 技术 正文
技术 2022年11月23日
0 收藏 371 点赞 3,370 浏览 1305 个字

布局文件:

<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>

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:8,960
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,484
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,330
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,113
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,745
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,779