セッション

コントローラのアクションメソッド内で

設定

 $this->getUser()->setAttribute('mesg', 'エラーが発生しました');

取得

 $mesg = $this->getUser()->getAttribute('mesg');

確認

 $mesg = $this->getUser()->hasAttribute('mesg');

削除

 $this->getUser()->getAttributeHolder()->remove('mesg'); 

テンプレートで

 <html><?php $sf_user->getAttribute('mesg')?></html>           

参考

http://symfony.xrea.jp/1.2/book/06-Inside-the-Controller-Layer.html#user.session


トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS

Last-modified: 2011-08-10 (水) 16:18:09