/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($id) { // $row = User::find($id); Former::populate($row); $this->layout->content = view::make('users.edit', compact('row', 'id')); }
protected function populateForm($model = false) { //dd($model); if ($model) { $address = $model->address; $venues = $model->venues; $companies = $model->companies; Former::populate($model); Former::populate($model, $model->address); } else { $address = []; $input = Input::All(); Former::populate($input); Former::populateField('address.email', $input['address']['email']); Former::populateField('address.phone', $input['address']['phone']); Former::populateField('address.country.name', $input['country']); Former::populateField('address.address', $input['address']['address']); Former::populateField('address.postal_code', $input['address']['postal_code']); Former::populateField('address.city', $input['address']['city']); Former::populateField('address.state_province', $input['address']['state_province']); Former::populateField('address.fax', $input['address']['fax']); Former::populateField('address.website', $input['address']['website']); //Former::populate( $input, $input ); } }
public function getEdit() { $user = User::editing(); if (!$user) { return Redirect::to(Config::get('admin_location') . '/users'); } Former::populate($user); return View::make('admin/users/edit')->with(array('user' => $user, 'users' => User::all())); }
public function populateForm($model = false) { if ($model) { Former::populate($model); } else { $input = Input::All(); Former::populate($input); } }
public function populateForm($model = false) { if ($model) { //$venues = $model->venues; //$tickets = $model->tickets; Former::populate($model); } else { $input = Input::All(); Former::populate($input); } }
public function populateForm($model = false) { if ($model) { $address = $model->address; Former::populate($model); Former::populate($model, $model->address); } else { $input = Input::All(); Former::populate($input); } }
public function populateForm($model = false) { if ($model) { $company = $model->company; $events = $model->events; $types = $model->types; Former::populate($model); } else { $input = Input::All(); Former::populate($input); } }
public function getEdit() { $category = Category::current(); // If the category doesn't exist, don't throw a 404 // just go back to the main page, likely a URL mistype if (!$category) { return Redirect::to(admin_path('categories')); } // Update our form data Former::populate($category); // Pass the category back to our view in case we need it return View::make('admin/categories/edit')->with('category', $category); }
public function populateForm($model = false) { if ($model) { $hotel1 = $model->first_hotel_option()->first(); $hotel2 = $model->second_hotel_option()->first(); $contact = $model->contacts()->first(); $venue = $model->venues; eerror_log(json_encode($hotel1)); Former::populate($model); // Former::populateField('first_hotel_option', $hotel1['name']); // Former::populateField('second_hotel_option', $hotel2['name']); } else { $input = Input::All(); Former::populate($input); } }
public function getEdit($id) { $row = Test::find($id); Former::populate($row); $this->layout->content = view::make('tests.edit', compact('row')); }
public function getEdit($id) { $controller_name = strtolower($this->controller_name); //$this->crumb->add(strtolower($this->controller_name).'/edit','Edit',false); //$model = $this->model; $_id = new MongoId($id); //$population = $model->where('_id',$_id)->first(); $population = $this->model->find($id)->toArray(); $population = $this->beforeUpdateForm($population); foreach ($population as $key => $val) { if ($val instanceof MongoDate) { $population[$key] = date('d-m-Y H:i:s', $val->sec); } } //print_r($population); //exit(); Former::populate($population); $this->title = $this->title == '' ? Str::singular($this->controller_name) : Str::singular($this->title); //$this->crumb->add(strtolower($this->controller_name).'/edit/'.$id,$id,false); return View::make(strtolower($this->controller_name) . '.' . $this->form_edit)->with('back', $controller_name)->with('formdata', $population)->with('submit', strtolower($this->controller_name) . '/edit/' . $id)->with('title', 'Edit ' . $this->title); }
public function populateForm($model = false) { if ($model) { $venues = $model->venues; $tickets = $model->tickets; $promoters = $model->users; $date = $model->date()->first(); $currency = $model->currency; Former::populate($model); if ($date) { Former::populateField('event_date', date('Y-m-d', strtotime($date->datetime_start))); } } else { $input = Input::All(); Former::populate($input); } }
protected function populateForm($tasktemplate = false) { if ($tasktemplate) { Former::populate($tasktemplate); } }