本文整理汇总了PHP中Illuminate\Session\Store::getToken方法的典型用法代码示例。如果您正苦于以下问题:PHP Store::getToken方法的具体用法?PHP Store::getToken怎么用?PHP Store::getToken使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Session\Store
的用法示例。
在下文中一共展示了Store::getToken方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Class constructor
*
* @param \Illuminate\Html\HtmlBuilder $html
* @param \Illuminate\Routing\UrlGenerator $url
* @param \Illuminate\Session\Store $session
* @param \Illuminate\Config\Repository $config
*/
public function __construct(HtmlBuilder $html, UrlGenerator $url, Session $session, Config $config)
{
$this->url = $url;
$this->html = $html;
$this->csrfToken = $session->getToken();
$this->config = $config;
$this->loadConfig();
$this->session = $session;
$this->errors = $session->get('errors');
}
示例2: __construct
/**
* The constructor
*
* @param HtmlBuilder $html
* @param UrlGenerator $url
* @param Session $session
*/
public function __construct(HtmlBuilder $html, UrlGenerator $url, Session $session)
{
parent::__construct($html, $url, $session->getToken());
$this->session = $session;
$this->requiredFields = [];
$this->errorFields = [];
if ($this->session->has('formhelper-required-fields')) {
$this->requiredFields = $this->session->get('formhelper-required-fields');
$this->session->forget('formhelper-required-fields');
}
if ($this->session->has('formhelper-error-fields')) {
$this->errorFields = $this->session->get('formhelper-error-fields');
$this->session->forget('formhelper-error-fields');
}
}
示例3: getToken
/**
* Get the CSRF token value.
*
* @return string
* @static
*/
public static function getToken()
{
return \Illuminate\Session\Store::getToken();
}
示例4: token
/**
* Generate a hidden field with the current CSRF token.
*
* @return string
*/
public function token()
{
$token = !empty($this->csrfToken) ? $this->csrfToken : $this->session->getToken();
return $this->hidden('_token', $token);
}