本文整理汇总了PHP中Collective\Html\FormBuilder::setSessionStore方法的典型用法代码示例。如果您正苦于以下问题:PHP FormBuilder::setSessionStore方法的具体用法?PHP FormBuilder::setSessionStore怎么用?PHP FormBuilder::setSessionStore使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Collective\Html\FormBuilder
的用法示例。
在下文中一共展示了FormBuilder::setSessionStore方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: registerFormBuilder
/**
* Register the form builder instance.
*
* @return void
*/
protected function registerFormBuilder()
{
$this->app->singleton('form', function ($app) {
$form = new FormBuilder($app['html'], $app['url'], $app['view'], $app['session.store']->getToken());
return $form->setSessionStore($app['session.store']);
});
}
示例2: register
/**
* Register the application services.
*/
public function register()
{
$this->mergeConfigFrom(__DIR__ . '/config/config.php', 'laform');
$this->app->bind('laform', 'Karan\\Laform\\Laform');
if (!$this->app->offsetExists('form')) {
$this->app->singleton('form', function ($app) {
// LaravelCollective\HtmlBuilder 5.2 is not backward compatible and will throw an exeption
// https://github.com/kristijanhusak/laravel-form-builder/commit/a36c4b9fbc2047e81a79ac8950d734e37cd7bfb0
if (substr(Application::VERSION, 0, 3) == '5.2') {
$form = new LaravelForm($app['html'], $app['url'], $app['view'], $app['session.store']->getToken());
} else {
$form = new LaravelForm($app['html'], $app['url'], $app['session.store']->getToken());
}
return $form->setSessionStore($app['session.store']);
});
if (!$this->aliasExists('Form')) {
AliasLoader::getInstance()->alias('Form', 'Collective\\Html\\FormFacade');
}
}
if (!$this->app->offsetExists('html')) {
$this->app->singleton('html', function ($app) {
return new HtmlBuilder($app['url'], $app['view']);
});
if (!$this->aliasExists('Html')) {
AliasLoader::getInstance()->alias('Html', 'Collective\\Html\\HtmlFacade');
}
}
}
示例3: registerFormBuilder
/**
* Register the form builder instance.
*
* @return void
*/
protected function registerFormBuilder()
{
$this->app->singleton('form', function ($app) {
/** @var Store $session */
$session = $app['session.store'];
$form = new FormBuilder($app['html'], $app['url'], $session->token());
$form->setSessionStore($session);
return $form;
});
$this->app->alias('form', 'Collective\\Html\\FormBuilder');
}
示例4: registerFormIfHeeded
/**
* Add Laravel Form to container if not already set
*/
private function registerFormIfHeeded()
{
if (!$this->app->offsetExists('form')) {
$this->app->singleton('form', function ($app) {
$form = new LaravelForm($app['html'], $app['url'], $app['view'], $app['session.store']->getToken());
return $form->setSessionStore($app['session.store']);
});
if (!$this->aliasExists('Form')) {
AliasLoader::getInstance()->alias('Form', 'Collective\\Html\\FormFacade');
}
}
}
示例5: setSessionStore
/**
* Set the session store implementation.
*
* @param \Illuminate\Session\Store $session
* @return $this
* @static
*/
public static function setSessionStore($session)
{
return \Collective\Html\FormBuilder::setSessionStore($session);
}