FuelPHP Bin
Sign in
Url:
Fork
Parent
<?php class Controller_Admin_Meta extends Controller_Admin{ public function action_index() { $data['meta'] = Model_Meta::find('all'); $this->template->title = "Meta-Einstellungen"; $this->template->content = View::forge('admin/meta/index', $data); } public function action_edit() { $client = Model_Client::find(Config::get('topclient')); \Debug::dump($client, 'hint'); #die; if (Input::method() == 'POST') { $post = Input::post(); unset($post['submit']); foreach($post as $key=>$value) { $client->meta[] = Model_Meta::forge(array('key' => $key, 'value' => $value)); }; if ($client->save()) { Session::set_flash('success', e('Bearbeitung erfolgreich')); Response::redirect('admin/meta'); } else { Session::set_flash('error', e('Bearbeitung NICHT erfolgreich')); } } $data['client'] = $client; $this->template->title = "Meta-Einstellungen"; $this->template->content = View::forge('admin/meta/edit', $data); } }