首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 开源软件 >

Yii: 利用Clip片断构建复杂界面

2012-10-06 
Yii: 利用Clip片段构建复杂界面layout:?!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN

Yii: 利用Clip片段构建复杂界面

layout:

?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html>    <head>        <title>Clip</title>    </head>    <body>        <div id="header">            this is header and main menu here        </div>        <div id="main">            <div id="left">                <?php echo $content ?>            </div>             <div id="right">                <div name="code">hello, this is the view 1 <?php $this->beginClip('submenu') ?>here is the sub menu for view 1<?php $this->endClip() ?> <?php $this->beginClip('desc') ?>here is the description for view 1<?php $this->endClip() ?>

?

?

hi, view 2 is here <?php $this->beginClip('submenu') ?>here is the sub menu for view 2<?php $this->endClip() ?> <?php $this->beginClip('desc') ?>here is the description for view 2<?php $this->endClip() ?>
?

注意:

当然clip也不是非常完美, 和django中的block相比,我们不能为每个clip都设定一个初始值,这样我们要在每个view中都给clip赋值,这有点小麻烦

热点排行