zoukankan      html  css  js  c++  java
  • PHP smarty函数

    模板继承

    fuji.html

    <title><{block name='biaoti'}><{/block}></title>
     <{block name='head'}><{/block}>
     <style type="text/css">
     .menu
     {
         width:100%;
         height:80px;
         background-color:#06F;     
     }
     .menus
     {
         float:left;
         width:100px;
         height:80px;
         line-height:80px;
         vertical-align:middle;
         text-align:center;
         margin-left:80px;
         color:#FFF; 
     }
     .dibu
     { 
         width:100%;
         height:100px;
         background-color:#06F;
         line-height:100px;
         vertical-align:middle;
         text-align:center;
         color:#FFF; 
     } 
     </style>
     
    </head>
    
    <body>
    <div class="menu">
        <div class="menus">主页</div>
        <div class="menus"><{$jianjie}></div>
        <div class="menus"><{$xinwen}></div>
        <div style="clear:both"></div>
    </div>
    <div style="100%;">
        <{block name='neirong'}><{/block}>
    </div>
    <div class="dibu">
          底部信息  
    </div>
    </body>

    zi.html

    <{extends file='fuji.html'}>
    <{block name='biaoti'}>
        子模板  
    <{/block}>
    <{block name='head'}>
      <style type="text/css">
          .neirong
        {
            width:100%;
            height:350px;
            color:#666;
        }
      </style>
    <{/block}>
    <{block name='neirong'}>
      <div class="neirong">
          <br>这是子模板
      </div>  
    <{/block}>

    zi.php

    <?php
    include("../init.inc.php");
    include("../../dbda.php");
    $db=new DBDA();
    
    $smarty->assign("jianjie","简介");
    $smarty->assign("xinwen","新闻");
    
    $smarty->display("zi.html");

  • 相关阅读:
    cocos2d-x Tests讲解 Particle System(粒子系统)
    c++ 知识点
    详解C/C++函数指针声明
    VS中的路径宏 vc++中OutDir、ProjectDir、SolutionDir各种路径
    cocos2d-x学习知识点记录
    Ogre实现简单地形
    Ogre内部渲染流程分析系列
    gcc/g++编译
    gcc和g++的区别
    Hack with rewrite
  • 原文地址:https://www.cnblogs.com/yy01/p/5701022.html
Copyright © 2011-2022 走看看