當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。