zoukankan      html  css  js  c++  java
  • phalcon: 视图分层渲染,或包含其他页面

    一:视图分层显现:

    比如:在一个页面中,头部、底部固定不变,只有中间部分随操作变换显示。那么可以将中间部分切出来,剩余部分用作固定框架,放入:app/views/layouts目录中,起名为:base.pthml,中间的部分存入相应的目录中去。

    接下来,我们看看base.phtml布局

    <html>
    <title>分层显示</title>
    <body>
    <p>分层渲染</p>
    
    <?php echo $this->getContent(); ?>
    
    
    </body>
    </html>

    中间部分的html不作修改,

    接下来看代码部分,怎么实现,controller:

    public function indexAction()
    	{
                //渲染页面,框架部分
                $this->view->setTemplateAfter('common');
    
                $this->view->pick("index/index");
            
    
    
    	}
    

      

    二:phtml包含其他页面

    <?php $this->view->partial("header");?>
    

      

  • 相关阅读:
    mac下配置openCV
    K最短路 A*算法
    KMP算法
    北航复试机试题
    1385重建二叉树
    二维数组中的查找
    简单的单向链表
    Getting Started with WebRTC [note]
    我的c漏洞
    PeerConnection
  • 原文地址:https://www.cnblogs.com/achengmu/p/5948652.html
Copyright © 2011-2022 走看看