* セッション [#n0f6e891]

** コントローラのアクションメソッド内で [#daf9590b]
 $this->getUser()->setAttribute('mesg', 'エラーが発生しました'); # 設定
 $mesg = $this->getUser()->getAttribute('mesg');                     # 取得
*** 設定 [#tda77766]
 $this->getUser()->setAttribute('mesg', 'エラーが発生しました');
*** 取得 [#m953525e]
 $mesg = $this->getUser()->getAttribute('mesg');
*** 確認 [#jbd3c1b0]
 $mesg = $this->getUser()->hasAttribute('mesg');
 $this->getUser()->getAttributeHolder()->remove('mesg');        # 削除
*** 削除 [#yedb4f72]
 $this->getUser()->getAttributeHolder()->remove('mesg'); 

** テンプレートで [#m238fa6f]
 <html><?php $sf_user->getAttribute('mesg')?></html>           

** 参考 [#p38d9b02]
http://symfony.xrea.jp/1.2/book/06-Inside-the-Controller-Layer.html#user.session

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