• 追加された行はこの色です。
  • 削除された行はこの色です。
* セッション [#n0f6e891]
 $this->getUser()->setAttribute('mesg', 'エラーが発生しました'); # 設定
 $mesg = $this->getUser()->getAttribute('mesg');                 # 取得

** コントローラのアクションメソッド内で [#daf9590b]
*** 設定 [#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'); 

 <html><?php $sf_user->getAttribute('mesg')?></html>             # テンプレートで参照する
** テンプレートで [#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