属性
ほとんどの 関数 には、
それらの動作を指定したり修正するための属性があります。Smarty 関数の属性は HTML
の属性にかなり近いものです。静的な値はクォートで囲む必要はありませんが、
リテラル文字列であるべきです。変数を使う場合はクォートで囲んではいけません。
いくつかの属性は、boolean 値 (TRUE あるいは
FALSE ) を必要とします。 これらの値は、クォートなしの
true 、 on
、yes あるいは false
、off 、 no
を指定する事が出来ます。
例 3-4. 関数の属性の構文
{include file='header.tpl'}
{include file='header.tpl' attrib_name='attrib value'}
{include file=$includeFile}
{include file=#includeFile# title='イケてる Smarty'}
{html_select_date display_days=yes}
{mailto address='smarty@example.com'}
<select name='company_id'>
{html_options options=$companies selected=$company_id}
</select>
|
|
今回のような実践的な経験がエンジニアのキャリアに繋がると思います。是非サービスを成功させて下さい!