PHPマニュアル/PEARマニュアル | ユーザフォーラムで議論/質問 | マニュアル検索 | ハイライト | ハイライトオフ | ポータル | php spot

Variables | JavaScript入門&応用&リファレンスなら「JavaScriptist」

  

Chapter 4. Variables

Smarty has several different types of variables. The type of the variable depends on what symbol it is prefixed with (or enclosed within).

Variables in Smarty can be either displayed directly or used as arguments for function attributes and modifiers, inside conditional expressions, etc. To print a variable, simply enclose it in the delimiters so that it is the only thing contained between them. Examples:
{$Name}

{$Contacts[row].Phone}

<body bgcolor="{#bgcolor#}">

Variables assigned from PHP

Variables that are assigned from PHP are referenced by preceding them with a dollar sign $. Variables assigned from within the template with the assign function are also displayed this way.

Example 4-1. assigned variables

Hello {$firstname}, glad to see you could make it.
<p>
Your last login was on {$lastLoginDate}.

OUTPUT:

Hello Doug, glad to see you could make it.
<p>
Your last login was on January 11th, 2001.
忘却曲線を使ってこの知識を確実に記憶に残す

フォーラムで「Variables」について話す
各種マニュアル: PHPマニュアル | PEARマニュアル | Smarty(英語)マニュアル | PHP-GTKマニュアル | Variables」をGoogle検索
copyright © 1997-2024 PHP ドキュメント作成グループ(ライセンス). provided by php spot. マニュアル: