rakutoネット
お問合せ 免責事項 Q&A 掲示板 サイト管理 リンク サイトマップ
HOME > HTML Template Sigma

HTML Template Sigma


HTML Template Sigma

速度テスト カレンダーを表示、繰り返しの重複。

HTML Template ITと殆ど同じ構造で、個人的には分かり易くなっていると思う。
テンプレートファイルから他のテンプレートファイルを呼び出せる機能があり、ヘッダー部分など使いまわす場合などに重宝。

htmltplSi.php

<?php
    require_once 'HTML/Template/Sigma.php';
    require_once 'rkt_calendar.php';
 
    /* HTML_Template_Sigmaオブジェクトの生成 */
    $tpl = new HTML_Template_Sigma('.');
    /* テンプレートファイルの読み込み */
    $tpl->loadTemplateFile('htmltplIT.tpl');
 
    /* カレンダーオブジェクト */
    $objcal = new RKT_calendar($date);
    $cals   = $objcal->getCalendar();
    $dates  = $objcal->getDates();
 
 
    $days = array();
    foreach ($cals as $weekly=>$days){
        foreach ($days as $day){
            /* 変数の受け渡し */
            $tpl->setVariable( array('day'=> $day) );
            $tpl->parse('week');            /* ブロック解析 */
        }
        $tpl->parse('cal');                 /* ブロック解析 */
 
    } // foreach ($cals as $weekly=>$days)
 
    /* 変数の受け渡し */
    $tpl->setVariable('month', $dates[RKT_MONTH]);
 
    $tpl->show();                               /* 表示 */ 
?>

htmltplSi.tpl

<table cellpadding="3" cellspacing="0" class="calendar"> 
    <tr class="calendar"> 
        <th class="calendar" colspan="7">{month}月</th> 
    </tr> 
    <tr class="calendar"> 
        <td class="holiday">日</td>
        <td class="calendar">月</td>
        <td class="calendar">火</td>
        <td class="calendar">水</td>
        <td class="calendar">木</td>
        <td class="calendar">金</td>
        <td class="saturday">土</td>
    </tr>
<!-- BEGIN cal -->
    <tr class="calendar">
<!-- BEGIN week --> 
        <td>{day}</td>
<!-- END week -->
    </tr>
<!-- END cal -->
</table>

<<HTML Template IT
Templateエンジンのすすめ Smarty>>

PHPリング

@PHP.ring Home
<5 <1 Random List 1> 5>

rktSQLite

  • sourceforge.jp

広告


アマゾン検索

サーチ:
Amazon.co.jpアソシエイト

カテゴリ

  •  Templateエンジンのすすめ Templateエンジンのすすめ
  •  SQLiteをやってみよう SQLiteをやってみよう
  •  SQLite SQLコマンド一覧 SQLiteコマンド一覧
  •  SQLite 管理プログラムSQLite 管理
  •  はじめてのEclipse はじめてのEclipse
  •  PHP SQLiteのTIPS PHP SQLiteのTIPS
  •  サンプル サンプル/ダウンロード
  •  リンク リンク
  •  掲示板 掲示板

メニュー

  •  Smartyの使用
  •  Templateエンジンとは
  •  色々なTemplateエンジン
  •  HTML Template IT
  •  HTML Template Sigma
  •  Smarty
  •  patTemplate
  •  HTMLテンプレート

キーワード検索

キーワード



最近のTB

  •  2006/03/13さくらのブログに挑戦[rakutoネットブログ]
  •  2006/01/20レーザーチャートの作成方法[脳内研究所]

Summary

  •     ATOM(XML)
  •     RDF(XML)
  •     RSS0.92(XML)
  •     RSS2.0(XML)

Powered by

  •     PHP
  •     Smarty
  •     SQLite
  •     MySQL
Copyright (C) 2005 `rakuto.net' All Rights Reserved.