smarty template engine
Friday, August 08, 2008  
download | documentation | faq | forum | mailing lists | changelog | contribs 


search for in the  


Atribut

Kebanyakan fungsi memerlukan atribut yang menetapkan atau mengubah perilakunya. Atribut bagi fungsi Smarty lebih mirip atribut HTML. Nilai statis tidak perlu ditutup dengan tanda kutip, tapi direkomendasikan untuk string literal. Variabel bisa juga dipakai, dan tidak boleh dalam tanda kutip.

Beberapa atribut memerlukan nilai boolean (TRUE atau FALSE). Ini dapat ditetapkan sebagai tanpa tanda kutip true, on, dan yes, atau false, off, dan no.

Teladan 3-4. sintaks atribut fungsi

{include file='header.tpl'}

{include file='header.tpl' attrib_name='attrib value'}

{include file=$includeFile}

{include file=#includeFile# title='Smarty is cool'}

{html_select_date display_days=yes}

{mailto address='smarty@example.com'}

<select name='company_id'>
  {html_options options=$companies selected=$company_id}
</select>



 

credits 

Smarty Copyright © 2002-2008
New Digital Group, Inc.

All rights reserved.