SpeedPHPフレームワークHTML関連関数


Smartyは一連のHTMLコード生成関数を提供しています.以下の例はすべてSmartyマニュアルから出ています.詳しくはSmarty中国語マニュアルを参照してください.
html_checkboxes
複数選択ボックスの生成
プログラム:
$this->cust_checkboxes = array(
            1000 => 'Joe Schmoe',
            1001 => 'Jack Smith',
            1002 => 'Jane Johnson',
            1003 => 'Charlie Brown'
);
$this->customer_id' = 1001;

テンプレート:
{html_checkboxes name="id"options=$cust_checkboxes checked=$customer_id separator="
"}
出力:








html_image
画像imgラベル、html_を生成イメージは画像の長さと幅を自動的に取得します.
テンプレート:
{html_image file="pumpkin.jpg"}
出力:

html_options
複数のドロップダウン・ボックス・オプション・グループを生成するには、自分で
    {html_options options=$cust_options selected=$customer_id}

出力:

html_radios
複数のラジオ・ボックスの生成
プログラム:
$this->cust_radios = array(
            1000 => 'Joe Schmoe',
            1001 => 'Jack Smith',
            1002 => 'Jane Johnson',
            1003 => 'Charlie Brown'
);
$this->customer_id' = 1001;

テンプレート:
{html_radios name="id"options=$cust_radios checked=$customer_id separator="
"}
出力:
Joe Schmoe



Jane Johnson

Charlie Brown

html_select_date
「生成年月日」ドロップダウン・ボックス
テンプレート:
{html_select_date month_format="%m"field_order="YMD"start_year="1950"}
html_select_time生成時分秒ドロップダウンボックス
{html_select_time use_24_hours=true}
html_table
テーブルの生成
プログラム:
$this->data = array(1,2,3,4,5,6,7,8,9);
テンプレート:
{html_table loop=$data cols=4 }
出力:




1234
5678
9