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


PHP Input::exists方法代码示例

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


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

示例1: getValue

 public function getValue()
 {
     parent::getValue();
     if (\Request::isMethod('post') && !Input::exists($this->name)) {
         $this->value = $this->unchecked_value;
     }
     $this->checked = (bool) ($this->value == $this->checked_value);
 }
开发者ID:greenelf,项目名称:rapyd-laravel,代码行数:8,代码来源:Checkbox.php

示例2: getNewValue

 public function getNewValue()
 {
     $process = Input::get('search') || Input::get('save') ? true : false;
     if ($process && Input::exists($this->name)) {
         if ($this->status == "create") {
             $this->action = "insert";
         } elseif ($this->status == "modify") {
             $this->action = "update";
         }
         if ($this->multiple) {
             $this->value = "";
             if (Input::get($this->name)) {
                 $values = Input::get($this->name);
                 if (!is_array($values)) {
                     $this->new_value = $values;
                 } else {
                     $this->new_value = implode($this->serialization_sep, $values);
                 }
             }
         } else {
             $this->new_value = HTML::xssfilter(Input::get($this->name));
         }
     } elseif ($this->action == "insert" && $this->insert_value != null) {
         $this->new_value = $this->insert_value;
     } elseif ($this->action == "update" && $this->update_value != null) {
         $this->new_value = $this->update_value;
     } else {
         $this->action = "idle";
     }
     if ($this->new_value == "") {
         $this->new_value = null;
     }
 }
开发者ID:phunghv,项目名称:firstbluz,代码行数:33,代码来源:Field.php

示例3: getNewValue

 public function getNewValue($forceProcess = false)
 {
     $process = Input::get('search') || Input::get('save') || $forceProcess ? true : false;
     if ($process && Input::exists($this->name)) {
         if ($this->status == "create") {
             $this->action = "insert";
         } elseif ($this->status == "modify") {
             $this->action = "update";
         }
         if ($this->multiple) {
             $this->value = "";
             if (Input::get($this->name)) {
                 $values = Input::get($this->name);
                 if (!is_array($values)) {
                     $this->new_value = $values;
                 } else {
                     $this->new_value = implode($this->serialization_sep, $values);
                 }
             }
         } else {
             $this->new_value = HTML::xssfilter(Input::get($this->name));
         }
     } elseif ($this->action == "insert" && $this->insert_value != null) {
         $this->edited = true;
         $this->new_value = $this->insert_value;
     } elseif ($this->action == "update" && $this->update_value != null) {
         $this->edited = true;
         $this->new_value = $this->update_value;
     } elseif ($this->type == 'auto') {
         //if is auto and no default is matched, keep the old value
         $this->new_value = $this->value;
     } else {
         $this->action = "idle";
     }
     if ($this->new_value == "") {
         $this->new_value = null;
     }
     //Run the pre_save_processor
     if (is_a($this->pre_save_processor, 'Closure') && $this->form) {
         $this->new_value = $this->pre_save_processor->__invoke($this->new_value, $this->form->fields, $this->form->model);
     }
 }
开发者ID:blackin,项目名称:rapyd-laravel,代码行数:42,代码来源:Field.php

示例4: getNewValue

 public function getNewValue()
 {
     $process = Input::get('search') || Input::get('save') ? true : false;
     if ($process && Input::exists($this->name)) {
         if ($this->status == "create") {
             $this->action = "insert";
         } elseif ($this->status == "modify") {
             $this->action = "update";
         }
         if ($this->multiple) {
             $this->value = "";
             if (Input::get($this->name)) {
                 $values = Input::get($this->name);
                 if (!is_array($values)) {
                     $this->new_value = $values;
                 } else {
                     $this->new_value = implode($this->serialization_sep, $values);
                 }
             }
         } else {
             if ($this->with_xss_filter) {
                 $this->new_value = HTML::xssfilter(Input::get($this->name));
             } else {
                 $this->new_value = Input::get($this->name);
             }
         }
     } elseif ($this->action == "insert" && $this->insert_value != null) {
         $this->edited = true;
         $this->new_value = $this->insert_value;
     } elseif ($this->action == "update" && $this->update_value != null) {
         $this->edited = true;
         $this->new_value = $this->update_value;
     } elseif ($this->type == 'auto') {
         //if is auto and no default is matched, keep the old value
         $this->new_value = $this->value;
     } else {
         $this->action = "idle";
     }
     if ($this->new_value == "") {
         $this->new_value = null;
     }
 }
开发者ID:JamesGuthrie,项目名称:rapyd-laravel,代码行数:42,代码来源:Field.php


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