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


PHP old函数代码示例

本文整理汇总了PHP中old函数的典型用法代码示例。如果您正苦于以下问题:PHP old函数的具体用法?PHP old怎么用?PHP old使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $data["message"] = old("top_message") ?: Session::pull("top_message");
     //不正アクセスアラートを受け取る
     $data["alert"] = old("top_alert");
     return view('top/index', $data);
 }
开发者ID:sugurusakashita,项目名称:A-plus,代码行数:12,代码来源:TopController.php

示例2: getValue

 public function getValue()
 {
     if ($this->name != '' && $this->model && isset($this->model->{$this->name})) {
         $this->value = $this->model->{$this->name};
     }
     return old($this->name, $this->value);
 }
开发者ID:eliasrosa,项目名称:bw-core,代码行数:7,代码来源:Field.php

示例3: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     $role = Role::findOrFail($id);
     $permissions = Permission::all();
     $assignedPermissions = old('permissions', $role->permissions()->lists('id')->toArray());
     return view('admin.roles.edit', compact('role', 'permissions', 'assignedPermissions'));
 }
开发者ID:laravolt,项目名称:foundation,代码行数:13,代码来源:RoleController.php

示例4: create

 public function create()
 {
     $data = [];
     foreach ($this->fields as $field => $default) {
         $data[$field] = old($field, $default);
     }
     return view("admin.coupon.create", ['data' => $data]);
 }
开发者ID:cdandy,项目名称:artup,代码行数:8,代码来源:CouponController.php

示例5: create

 public function create()
 {
     $data = [];
     foreach ($this->fields as $field => $default) {
         $data[$field] = old($field, $default);
     }
     return view("admin.itemType.create", $data);
 }
开发者ID:cdandy,项目名称:artup,代码行数:8,代码来源:ItemTypeController.php

示例6: formValue

 public static function formValue($field, $modelField = '')
 {
     if (old($field)) {
         return old($field);
     } else {
         return $modelField;
     }
 }
开发者ID:stevencook,项目名称:text-reminders,代码行数:8,代码来源:Formatter.php

示例7: render

 public function render(array $attributes = [], array $viewData = [])
 {
     $this->options = array_merge($this->options, $attributes);
     $value = old(str_replace('[]', '', $this->name), $this->getOption('value'));
     unset($this->options['value']);
     $this->setSelectOptions($value);
     return parent::render($attributes, $viewData);
 }
开发者ID:administrcms,项目名称:form,代码行数:8,代码来源:Select.php

示例8: getValue

 function getValue()
 {
     if ($this->useOldValue && \Request::hasSession()) {
         return old($this->name, $this->value);
     } else {
         return $this->value;
     }
 }
开发者ID:plokko,项目名称:FormBuilder,代码行数:8,代码来源:FormField.php

示例9: index

 public function index()
 {
     $settings = ['sms_off_enabled', 'sms_off_to', 'sms_off_message', 'sms_on_enabled', 'sms_on_to', 'sms_on_message', 'sms_login', 'email_off_enabled', 'email_off_to', 'email_off_subject', 'email_off_message', 'email_on_enabled', 'email_on_to', 'email_on_subject', 'email_on_message', 'email_from'];
     foreach ($settings as $key) {
         $data[$key] = old($key, Setting::get($key));
     }
     return view('settings', $data);
 }
开发者ID:maxiv,项目名称:router-pulse,代码行数:8,代码来源:Settings.php

示例10: create

 /**
  * Show the form for creating a new resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function create()
 {
     $data = [];
     foreach ($this->fields as $field => $default) {
         $data[$field] = old($field, $default);
     }
     return view('blog.post', $data);
 }
开发者ID:EuropeanRespiratorySociety,项目名称:ERSTemplate-dev,代码行数:13,代码来源:Blog.php

示例11: oom

function oom($oldField, $modelField)
{
    if (strlen(old($oldField)) > 0) {
        return old($oldField);
    } else {
        return $modelField;
    }
}
开发者ID:CameronK,项目名称:forcept,代码行数:8,代码来源:ViewHelper.php

示例12: formText

 function formText($col, $name, $id, $errors, $label = '', $icon = '', $memory = true, $value = '', $type = 'text')
 {
     return sprintf('
         <div class="input-field col %s">
             <input type="%s" name="%s" id="%s" class="validate %s" value="%s"/>
             <label for="%s">%s</label>
         </div>', $col, $type, $name, $id, $errors->first($name) ? 'invalid' : '', $memory ? old($name) ? old($name) : $value : $value, $id, $label ? '<i class="material-icons">' . $icon . '</i>' . $label : '');
 }
开发者ID:forehalo,项目名称:materialize-blog,代码行数:8,代码来源:helpers.php

示例13: create

 /**
  * @param \Yajra\CMS\Entities\Navigation $navigation
  * @param \Yajra\CMS\Entities\Menu $menu
  * @return mixed
  */
 public function create(Navigation $navigation, Menu $menu)
 {
     $menu->extension_id = old('extension_id', Extension::MENU_INTERNAL);
     $menu->published = true;
     $menu->setHighestOrderNumber();
     $menu->load('extension');
     return view('administrator.navigation.menu.create', compact('navigation', 'menu'));
 }
开发者ID:yajra,项目名称:cms-core,代码行数:13,代码来源:MenuItemsController.php

示例14: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     $skilltag = SkillsTag::findOrFail($id);
     $data = ['id' => $id];
     foreach (array_keys($this->fields) as $field) {
         $data[$field] = old($field, $skilltag->{$field});
     }
     return view('admin.pages.skill-tag-edit', $data);
 }
开发者ID:gabrieljaime,项目名称:Payroll-Laravel5,代码行数:15,代码来源:SkillsTagController.php

示例15: edit

 /**
  * Show the form for editing a tag
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $tag = Tag::findOrFail($id);
     $data = ['id' => $id];
     foreach (array_keys($this->fields) as $field) {
         $data[$field] = old($field, $tag->{$field});
     }
     return view('admin.tag.edit', $data);
 }
开发者ID:guduchango,项目名称:l5beauty,代码行数:15,代码来源:TagController.php


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