當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CSRF::getToken方法代碼示例

本文整理匯總了PHP中CSRF::getToken方法的典型用法代碼示例。如果您正苦於以下問題:PHP CSRF::getToken方法的具體用法?PHP CSRF::getToken怎麽用?PHP CSRF::getToken使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CSRF的用法示例。


在下文中一共展示了CSRF::getToken方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: executeShow

 public function executeShow(sfWebRequest $request)
 {
     $this->forward404Unless($this->inbox = Doctrine::getTable('Inbox')->find(array($request->getParameter('id'))), sprintf('Object inbox does not exist (%s).', $request->getParameter('id')));
     $this->comments = Comment::getFor($this->inbox);
     $this->form = new CommentInboxForm();
     $this->form->setCommented($this->inbox);
     $this->form->setDefault('noVote', 1);
     $this->inboxed = Doctrine_Query::create()->select()->from('sfGuardUserProfile p')->leftJoin('p.Inboxed i')->where('i.inbox_id = ?', $this->inbox->getId())->execute();
     $this->csrf = CSRF::getToken();
 }
開發者ID:limitium,項目名稱:uberlov,代碼行數:10,代碼來源:actions.class.php

示例2: executeMy

 public function executeMy(sfWebRequest $request)
 {
     $this->csrf = CSRF::getToken();
     $this->locations = $this->getUser()->getProfile()->getLocation();
 }
開發者ID:limitium,項目名稱:uberlov,代碼行數:5,代碼來源:actions.class.php

示例3: executeShow

 public function executeShow(sfWebRequest $request)
 {
     $this->profile = Doctrine::getTable('sfGuardUserProfile')->createQuery("p")->leftJoin('p.VoteProfile')->leftJoin('p.User')->where('p.id = ?', $request->getParameter('id'))->execute()->getFirst();
     $this->forward404Unless($this->profile);
     $this->view = $request->getParameter('view');
     if (!in_array($this->view, array('comments', 'profits', 'locations'))) {
         $this->view = 'profile';
     }
     //@todo: join commmented objects
     $this->comments = Doctrine_Query::create()->from('Comment c')->leftJoin('c.VoteComment')->where('c.created_by = ? and c.parent > 0', $this->profile->getId())->andWhere('c.inbox_id is null')->orderBy('c.created_at desc');
     $this->comments = Doctrine::getTable('Comment')->filterScope($this->comments, $this->getUser())->execute();
     $this->profits = Doctrine_Query::create()->from('Profit p')->leftJoin('p.ProfitDetail d')->leftJoin('p.Location l')->leftJoin('d.Fish f')->leftJoin('d.Style s')->leftJoin('p.CommentProfit')->leftJoin('p.VoteProfit')->andWhere('p.created_by = ?', $this->profile->getId())->orderBy('p.created_at desc');
     $this->profits = Doctrine::getTable('Location')->filterScope($this->profits, $this->getUser())->execute();
     $this->locations = Doctrine::getTable('Location')->getVisibleLocationsQuery($this->getUser())->leftJoin('l.VoteLocation v')->leftJoin('l.CommentLocation c')->andWhere('l.created_by = ?', $this->profile->getId())->orderBy('l.created_at desc')->execute();
     //@todo: add events
     $this->total = 0;
     $this->best = array('name' => 'фигавль', 'qty' => 0, 'location' => null);
     foreach ($this->profits as $profit) {
         if ($this->best['qty'] < $profit->getWeight()) {
             $this->best['qty'] = $profit->getWeight();
             $this->best['name'] = $profit->getFish();
             $this->best['location'] = $profit->getLocation();
         }
         foreach ($profit->getProfitDetail() as $pd) {
             $this->total += $pd->getQty();
         }
     }
     $this->csrf = CSRF::getToken();
 }
開發者ID:limitium,項目名稱:uberlov,代碼行數:29,代碼來源:actions.class.php


注:本文中的CSRF::getToken方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。