[Symfony1.4] Template Modification: setTemplate

Tadashi Shigeoka ·  Mon, November 14, 2011

I researched template modification in Symfony1.4, so here’s a memo. The setTemplate method is used to modify templates.

■ Method to directly specify the template file path

$this->setTemplate('テンプレートファイルの絶対パス、または、相対パス'); 

■ Method to specify a template corresponding to an action

$this->setTemplate('Edit');

In this case, we’re calling the template corresponding to the Edit action.

■ return sfView::SUCCESS

When all action processing is finished, if nothing is written, sfView::SUCCESS is returned.

There are also sfView::NONE, sfView::ERROR, etc.

■ Articles to read when researching templates

(Official)

A Gentle Introduction to symfony | 第6章 - コントローラーレイヤーの内側 | symfony | Web PHP Framework

Practical symfony | 14日目: フィード | symfony | Web PHP Framework  

(Blog articles, etc.)

例外発生時のテンプレートの変更 - ゆっくり*ゆっくり

symfonyでsymfuldaze

WEBアプリケーション研究室 開発ノート [symfony] 特定のテンプレートを強制的に表示

That’s all from the Gemba.