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");

  • 相关阅读:
    每日一题-mysql(持续更新)
    http面试问题集锦
    存储测试简析
    横向越权测试—安全漏洞
    性能数据的准备-Jmeter
    获取当天七天时间
    vue生命周期
    vue的全选与反选
    filter兼容问题
    Http与Https
  • 原文地址:https://www.cnblogs.com/yy01/p/5701022.html
Copyright © 2011-2022 走看看