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


PHP Store::pull方法代码示例

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


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

示例1: populate

 /**
  * Populate the fields with entry values.
  *
  * @param FormBuilder $builder
  */
 public function populate(FormBuilder $builder)
 {
     $fields = $builder->getFields();
     $entry = $builder->getFormEntry();
     foreach ($fields as &$field) {
         /*
          * If the field is not already set
          * then get the value off the entry.
          */
         if (!isset($field['value']) && $entry instanceof EloquentModel && $entry->getId()) {
             if ($locale = array_get($field, 'locale')) {
                 $field['value'] = $entry->translateOrDefault($locale)->{$field['field']};
             } else {
                 $field['value'] = $entry->{$field['field']};
             }
         }
         /*
          * If the field has a default value
          * and the entry does not exist yet
          * then use the default value.
          */
         if (isset($field['config']['default_value']) && $entry instanceof EloquentModel && !$entry->getId()) {
             $field['value'] = $field['config']['default_value'];
         }
         /*
          * If the field has a default value
          * and there is no entry then
          * use the default value.
          */
         if (isset($field['config']['default_value']) && !$entry) {
             $field['value'] = $field['config']['default_value'];
         }
         /*
          * If the field is an assignment then
          * use it's config for the default value.
          */
         if (!isset($field['value']) && $entry instanceof EntryInterface && ($type = $entry->getFieldType($field['field']))) {
             $field['value'] = array_get($type->getConfig(), 'default_value');
         }
         /*
          * Lastly if we have flashed data from a front end
          * form handler then use that value for the field.
          */
         if ($this->session->has($field['prefix'] . $field['field'])) {
             $field['value'] = $this->session->pull($field['prefix'] . $field['field']);
         }
     }
     $builder->setFields($fields);
 }
开发者ID:huglester,项目名称:streams-platform,代码行数:54,代码来源:FieldPopulator.php

示例2: message

 /**
  * Flash a general message.
  *
  * @param string $message
  * @param string $level
  * @param bool   $overlay
  *
  * @return $this
  */
 public function message($message, $level = 'info', $title = 'Notice', $overlay = false)
 {
     $messages = $this->session->pull('flash_notification.messages', []);
     $messages[] = compact('message', 'level', 'title', 'overlay');
     $this->session->flash('flash_notification.messages', $messages);
     return $this;
 }
开发者ID:phaza,项目名称:Laravel-Flash,代码行数:16,代码来源:FlashNotifier.php

示例3: pull

 /**
  * Get the value of a given key and then forget it.
  *
  * @param string $key
  * @param string $default
  * @return mixed 
  * @static 
  */
 public static function pull($key, $default = null)
 {
     return \Illuminate\Session\Store::pull($key, $default);
 }
开发者ID:satriashp,项目名称:tour,代码行数:12,代码来源:_ide_helper.php

示例4: intended

 /**
  * Create a new redirect response to the previously intended location.
  *
  * @param  string  $default
  * @param  int     $status
  * @param  array   $headers
  * @param  bool    $secure
  * @return \Illuminate\Http\RedirectResponse
  */
 public function intended($default = '/', $status = 302, $headers = [], $secure = null)
 {
     $path = $this->session->pull('url.intended', $default);
     return $this->to($path, $status, $headers, $secure);
 }
开发者ID:illuminate,项目名称:routing,代码行数:14,代码来源:Redirector.php

示例5: pull

 /**
  * {@inheritdoc}
  */
 public function pull($index, $default = null)
 {
     return $this->session->pull($index, $default);
 }
开发者ID:xaamin,项目名称:session,代码行数:7,代码来源:Session.php

示例6: flush

 public function flush()
 {
     return $this->session->pull('__messages', new Collection());
 }
开发者ID:portonefive,项目名称:essentials,代码行数:4,代码来源:MessageManager.php

示例7: pull

 /**
  * {@inheritdoc}
  */
 public function pull()
 {
     return $this->session->pull($this->getKey());
 }
开发者ID:shinichi81,项目名称:whatsapi-1,代码行数:7,代码来源:Session.php

示例8: sessionEnded

 /**
  * @return bool
  */
 private function sessionEnded()
 {
     $lastActivityTime = $this->session->pull('lastActivityTime');
     return $lastActivityTime && $this->timeExceeded($lastActivityTime);
 }
开发者ID:Hasnayeen,项目名称:blog,代码行数:8,代码来源:SessionTimeout.php

示例9: pull

 /**
  * Pull the messages.
  *
  * @param $type
  * @return array
  */
 public function pull($type)
 {
     return $this->session->pull($type);
 }
开发者ID:huglester,项目名称:streams-platform,代码行数:10,代码来源:MessageBag.php


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