本文整理汇总了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);
}
示例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);
}
示例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'));
}
示例4: create
public function create()
{
$data = [];
foreach ($this->fields as $field => $default) {
$data[$field] = old($field, $default);
}
return view("admin.coupon.create", ['data' => $data]);
}
示例5: create
public function create()
{
$data = [];
foreach ($this->fields as $field => $default) {
$data[$field] = old($field, $default);
}
return view("admin.itemType.create", $data);
}
示例6: formValue
public static function formValue($field, $modelField = '')
{
if (old($field)) {
return old($field);
} else {
return $modelField;
}
}
示例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);
}
示例8: getValue
function getValue()
{
if ($this->useOldValue && \Request::hasSession()) {
return old($this->name, $this->value);
} else {
return $this->value;
}
}
示例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);
}
示例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);
}
示例11: oom
function oom($oldField, $modelField)
{
if (strlen(old($oldField)) > 0) {
return old($oldField);
} else {
return $modelField;
}
}
示例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 : '');
}
示例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'));
}
示例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);
}
示例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);
}