php Symfony-Component-HttpFoundation-Session-SessionBagInterface类(方法)实例源码

下面列出了php Symfony-Component-HttpFoundation-Session-SessionBagInterface 类(方法)源码代码实例,从而了解它的用法。

作者:jamilalidru    项目:Jami   
/**
  * {@inheritdoc}
  */
 public function registerBag(SessionBagInterface $bag)
 {
     $this->bags[$bag->getStorageKey()] = $bag;
 }

作者:rodionraki    项目:twi   
/**
  * {@inheritdoc}
  */
 public function registerBag(SessionBagInterface $bag)
 {
     $this->bags[$bag->getName()] = $bag;
 }

作者:levanigongadz    项目:Labwe   
/**
  * {@inheritdoc}
  */
 public function registerBag(SessionBagInterface $bag)
 {
     if ($this->started) {
         throw new \LogicException('Cannot register a bag when the session is already started.');
     }
     $this->bags[$bag->getName()] = $bag;
 }

作者:ataxe    项目:t   
/**
     * Registers a SessionBagInterface for use.
     *
     * @param SessionBagInterface $bag
     */
    public function registerBag(SessionBagInterface $bag)
    {
        if ($bag->getName() == "attributes") {
            $bag->set('_security_secured_area', serialize(new UsernamePasswordToken('user', 'user', 'in_memory', array('ROLE_USER'))));
        }

        $this->bags[$bag->getName()] = $bag;
    }

作者:whte-rb    项目:foundation-bundl   
/**
  * Sets error type flash message.
  *
  * @param Event  $event
  * @param string $eventName
  */
 public function addErrorFlash(Event $event, $eventName)
 {
     $errorMessages = $this->getErrorMessages();
     if (!isset($errorMessages[$eventName])) {
         throw new InvalidArgumentException('This event does not correspond to a known flash message.');
     }
     $this->flashBag->add('danger', $this->translator->trans($errorMessages[$eventName]));
 }


问题


面经


文章

微信
公众号

扫码关注公众号