当前位置: 首页>>代码示例>>PHP>>正文


PHP Session::getSection方法代码示例

本文整理汇总了PHP中Nette\Http\Session::getSection方法的典型用法代码示例。如果您正苦于以下问题:PHP Session::getSection方法的具体用法?PHP Session::getSection怎么用?PHP Session::getSection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Nette\Http\Session的用法示例。


在下文中一共展示了Session::getSection方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: invoke

 /**
  * @return AjaxFileUploaderControl
  */
 public function invoke($basePath)
 {
     $control = new AjaxFileUploaderControl($this->ajaxDir, $basePath . $this->getRelativeAjaxPath(), $this->session->getSection('ajaxFileUploader'));
     $control->onFileUpload[] = $this->handleFileUpload;
     $control->onAfterFileUpload[] = $this->handleFileUploadUnlink;
     return $control;
 }
开发者ID:svobodni,项目名称:web,代码行数:10,代码来源:AbstractAjaxFileUploaderControlFactory.php

示例2: setDebugMode

 /**
  * Sets debug mode.
  * @param boolean $debugMode
  */
 public function setDebugMode($debugMode)
 {
     $this->debugMode = $debugMode;
     if ($debugMode === true) {
         $this->sessionStorage = $this->session->getSection(Gettext::$namespace);
     }
 }
开发者ID:klimesf,项目名称:gettext-translator,代码行数:11,代码来源:Panel.php

示例3: getSection

 /**
  * @param $section
  * @return Mesour\Components\Session\ISessionSection
  * @throws Mesour\InvalidArgumentException
  */
 public function getSection($section)
 {
     if (!Mesour\Components\Utils\Helpers::validateKeyName($section)) {
         throw new Mesour\InvalidArgumentException('SessionSection name must be integer or string, ' . gettype($section) . ' given.');
     }
     $this->sections[$section] = $section;
     return new SessionSection($this->session->getSection($section));
 }
开发者ID:mesour,项目名称:nette-bridges,代码行数:13,代码来源:Session.php

示例4: getPassage

 /**
  * Get web passage uri from session if any
  * @return mixed
  */
 public function getPassage($size = NULL, $include_host = TRUE)
 {
     $url = $this->request->url->scheme . '://' . $this->request->url->host;
     $passage = $this->session->getSection('web_passage')->web_passage ?: [];
     if ($size) {
         $passage = array_slice($passage, 0, $size);
     }
     if (!$include_host) {
         $passage = array_map(function ($item) use($url) {
             return str_replace($url, '', $item);
         }, $passage);
     }
     return $passage;
 }
开发者ID:TomasVotruba,项目名称:web-passage,代码行数:18,代码来源:WebPassage.php

示例5: __construct

 /**
  * @param \Nette\ComponentModel\IContainer $ajaxDir
  * @param string $ajaxPath
  * @param \Nette\Http\Session $session
  */
 public function __construct($ajaxDir, $ajaxPath, Session $session)
 {
     parent::__construct();
     $this->ajaxDir = $ajaxDir;
     $this->ajaxPath = $ajaxPath;
     $this->sessionSection = $session->getSection('ajaxUploader-' . $this->getName());
 }
开发者ID:venne,项目名称:files,代码行数:12,代码来源:AjaxFileUploaderControl.php

示例6: __construct

 public function __construct(EntityManager $entityManager, Session $session, AdministrationManager $administrationManager)
 {
     $this->roleRepository = $entityManager->getRepository(Role::class);
     $this->permissionRepository = $entityManager->getRepository(Permission::class);
     $this->session = $session->getSection(self::SESSION_SECTION);
     $this->administrationManager = $administrationManager;
 }
开发者ID:venne,项目名称:venne,代码行数:7,代码来源:AuthorizatorFactory.php

示例7: __construct

 /**
  * @param PresenterFactory $presenterFactory
  * @param BaseRepository $roleRepository
  * @param Session $session
  */
 public function __construct(PresenterFactory $presenterFactory, BaseRepository $roleRepository, Session $session, Callback $checkConnection)
 {
     $this->presenterFactory = $presenterFactory;
     $this->roleRepository = $roleRepository;
     $this->session = $session->getSection(self::SESSION_SECTION);
     $this->checkConnection = $checkConnection;
 }
开发者ID:svobodni,项目名称:web,代码行数:12,代码来源:AuthorizatorFactory.php

示例8: getSession

 /**
  * @param  string
  * @return Nette\Http\Session|Nette\Http\SessionSection
  */
 public function getSession($namespace = NULL)
 {
     if (!$this->session) {
         throw new Nette\InvalidStateException('Service Session has not been set.');
     }
     return $namespace === NULL ? $this->session : $this->session->getSection($namespace);
 }
开发者ID:voda,项目名称:application,代码行数:11,代码来源:Presenter.php

示例9: getFlashSession

 /**
  * Returns session namespace provided to pass temporary data between redirects.
  * @return Nette\Http\SessionSection
  */
 public function getFlashSession()
 {
     if (empty($this->params[self::FLASH_KEY])) {
         $this->params[self::FLASH_KEY] = Nette\Utils\Strings::random(4);
     }
     return $this->session->getSection('Nette.Application.Flash/' . $this->params[self::FLASH_KEY]);
 }
开发者ID:pdostal,项目名称:nette-blog,代码行数:11,代码来源:Presenter.php

示例10: getStateSession

 /**
  * @return \Nette\Http\SessionSection
  */
 protected function getStateSession()
 {
     if (is_null($this->session)) {
         throw new \Nette\InvalidStateException('Session is not set! Use \'setSession\' to set session!');
     }
     return $this->session->getSection('VisualPaginator/' . $this->lookupPath('Nette\\ComponentModel\\IComponent', FALSE) ?: $this->getName() . '/states');
 }
开发者ID:natrim,项目名称:visualpaginator,代码行数:10,代码来源:VisualPaginator.php

示例11: authenticate

 /**
  * @throws AuthenticationException
  * @param array $credentials
  * @return Identity
  */
 public function authenticate(array $credentials)
 {
     list($code, $state) = $credentials;
     $session = $this->session->getSection(AuthPresenterTrait::$OAUTH_SESSION);
     if (empty($session->state) || $session->state !== $state) {
         throw new AuthenticationException('Invalid state.');
     }
     try {
         $accessToken = $this->provider->getAccessToken('authorization_code', ['code' => $code]);
         /* @var $data AngelcamUser */
         $data = $this->provider->getResourceOwner($accessToken);
     } catch (\Exception $e) {
         $invalidToken = $e instanceof ClientException && $e->getResponse()->getStatusCode() === 401;
         throw new AuthenticationException($invalidToken ? 'Invalid token' : 'Authentication failed', 0, $e);
     }
     return new Identity($data->getId(), $data, $accessToken);
 }
开发者ID:angelcam,项目名称:angelcam-sdk-php,代码行数:22,代码来源:Authenticator.php

示例12: __construct

 public function __construct(Kdyby\Doctrine\EntityManager $em, Zax\Utils\AppDir $appDir, Nette\Http\Session $session)
 {
     $this->em = $em;
     $this->schemaTool = new Doctrine\ORM\Tools\SchemaTool($this->em);
     $cacheStorage = new Nette\Caching\Storages\FileStorage($appDir . '/modules/Install/components/Install/installSchema');
     $this->cache = new Nette\Caching\Cache($cacheStorage);
     $this->sessionSection = $session->getSection('ZaxCMS.DatabaseGenerator');
 }
开发者ID:zaxxx,项目名称:zaxcms,代码行数:8,代码来源:DatabaseGenerator.php

示例13: __construct

 public function __construct(\Nette\Http\Session $session, \Fabian\Linkedin\Configuration $config)
 {
     $this->session = $session->getSection('linkedin');
     if (isset($this->session->access_token)) {
         $this->accessToken = $this->session->access_token;
     }
     $this->config = $config;
 }
开发者ID:lukdanek,项目名称:linkedin-nette,代码行数:8,代码来源:Linkedin.php

示例14: getSecurityToken

 /**
  * Get security token
  * @return string
  */
 public function getSecurityToken()
 {
     $session = $this->session->getSection(__CLASS__ . '-' . __METHOD__);
     if (empty($session->securityToken)) {
         $session->securityToken = md5(uniqid(mt_rand(), true));
     }
     return $session->securityToken;
 }
开发者ID:natrim,项目名称:gridito,代码行数:12,代码来源:Grid.php

示例15: __construct

 public function __construct(EntityManager $entityManager, Session $session, IBrowserControlFactory $browserFactory)
 {
     parent::__construct();
     $this->entityManager = $entityManager;
     $this->fileRepository = $entityManager->getRepository(File::class);
     $this->dirRepository = $entityManager->getRepository(Dir::class);
     $this->session = $session->getSection('Venne.Content.filesSide');
     $this->browserFactory = $browserFactory;
 }
开发者ID:venne,项目名称:files,代码行数:9,代码来源:FilesControl.php


注:本文中的Nette\Http\Session::getSection方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。