本文整理匯總了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);
}