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