Smarty Archive
pearコマンドでSmartyをインストール
- 2007/12/19
- Categories: Smarty
自分で忘れないためのエントリー。
PearコマンドでSmartyがインストールできるらしい。
まず、以下のコマンドを打ち、パッケージ配布先(channel)を追加する。
# pear channel-discover pearified.com
そしたらチャンネルを確認してみる。
# pear list-channels Registered Channels: ==================== Channel Summary pear.php.net PHP Extension and Application Repository pearified.com PEAR-Compatible Extension and Application Repository pecl.php.net PHP Extension Community Library __uri Pseudo-channel for static packages
上記のように、pearified.comが追加されているのがわかる。
続いて、PearコマンドでSmartyをインストールする。
- Comments: 0
- Trackbacks: 0
Smartyで単純なforループを作る
いや〜、目からウロコです。
Smartyには、foreachやsectionなどのループ関数があるのですが、単純なforループみたいなことはできないのか?と思い、検索したら上記URLにたどり着きました。
なるほど!!、、、と。
PHPで下のようなforループをやりたいとする。
for ($i=0; $i<10; $i++){
echo $i;
}
これをSmartyでやろうとすると、こうなる。
- Comments: 0
- Trackbacks: 0
-
-
- CakePHPでcronを使う方法 - ElectricBrain Standard
- [CakePHP] モデルでキャッシュする方法 - ElectricBrain Standard
- 開発者のためのテキストエディタ 15選 - ElectricBrain Standard
- [PHP] XML-RPCを使ってWordPressに投稿する - ElectricBrain Standard
- Windowsでcronが使えるツール「pycron」 - ElectricBrain Standard
- [Twitter] 検索系APIの使い方 - ElectricBrain Standard
- [font] 持ってて損はないフリーできれいなサンセリフ・フォント 10選 - ElectronicBrain is eating BreakFast


















































