本文整理汇总了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();
}
示例2: executeMy
public function executeMy(sfWebRequest $request)
{
$this->csrf = CSRF::getToken();
$this->locations = $this->getUser()->getProfile()->getLocation();
}
示例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();
}