本文整理汇总了PHP中Nette\Http\Session::start方法的典型用法代码示例。如果您正苦于以下问题:PHP Session::start方法的具体用法?PHP Session::start怎么用?PHP Session::start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Nette\Http\Session
的用法示例。
在下文中一共展示了Session::start方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _before
protected function _before()
{
$this->session = new \Nette\Http\Session(new \Nette\Http\Request(new \Nette\Http\UrlScript()), new \Nette\Http\Response());
$this->session = new \Kdyby\FakeSession\Session($this->session);
$this->session->start();
$this->wizard = new Wizard($this->session);
}
示例2: start
/**
* Do not call directly. Use Session::getNamespace().
*/
private function start()
{
if ($this->meta === FALSE) {
$this->session->start();
$this->data =& $_SESSION['__NF']['DATA'][$this->name];
$this->meta =& $_SESSION['__NF']['META'][$this->name];
}
}
示例3: __construct
/**
* @param string $defaultLang
* @param ITranslatorStorage $translatorStorage
* @param Nette\Http\Session $session
* @param Nette\Application\Application $application
*/
public function __construct($defaultLang, ITranslatorStorage $translatorStorage, Nette\Http\Session $session, Nette\Application\Application $application)
{
$this->setDefaultLang($defaultLang);
$this->translatorStorage = $translatorStorage;
$session->start();
$this->session = $session;
$this->application = $application;
}
示例4: register
/**
* Registers CaptchaControl to the \Nette\Forms\Container, starts session and sets $defaultFontFile (if not set)
*
* @param \Nette\Http\Session $session session
* @throws \Nette\InvalidStateException
* @return void
*/
public static function register(Session $session)
{
if (self::$registered === TRUE) {
throw new InvalidStateException(__CLASS__ . ' is already registered.');
}
if ($session->isStarted() === FALSE) {
$session->start();
}
self::$session = $session->getSection(__CLASS__);
if (!self::$defaultFontFile) {
self::$defaultFontFile = __DIR__ . '/fonts/Vera.ttf';
}
Container::extensionMethod('addCaptcha', function ($container, $name) {
return $container[$name] = new static();
});
self::$registered = TRUE;
}
示例5: register
/**
* Register CaptchaControl to FormContainer, start session and set $defaultFontFile (if not set)
* @return void
* @throws \Nette\InvalidStateException
*/
public static function register(Session $session)
{
if (self::$registered) {
throw new \Nette\InvalidStateException(__CLASS__ . " is already registered");
}
if (!$session->isStarted()) {
$session->start();
}
self::$session = $session->getSection(__CLASS__);
if (!self::$defaultFontFile) {
self::$defaultFontFile = __DIR__ . "/fonts/Vera.ttf";
}
FormContainer::extensionMethod('addCaptcha', callback(__CLASS__, 'addCaptcha'));
self::$registered = TRUE;
}
示例6: __construct
public function __construct(Container $container)
{
$this->container = $container;
$this->session = $container->getByType('Nette\\Http\\Session');
$this->session->start();
}
示例7: __construct
public function __construct(Session $session)
{
$this->session = $session;
$this->sessSect = $session->getSection('session');
$session->start();
}