FuelPHP Bin
<?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->$key = $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); } } <?php class Controller_Admin_Settings extends Controller_Admin{ public function action_index() { $data['settings'] = Model_Setting::find('all'); $this->template->title = "Einstellungen"; $this->template->content = View::forge('admin/settings/index', $data); } public function action_edit() { $client = Model_Client::find(Config::get('topclient')); if (Input::method() == 'POST') { $post = Input::post(); unset($post['submit']); foreach($post as $key=>$value) { $client->$key = $value; }; if ($client->save()) { Session::set_flash('success', e('Bearbeitung erfolgreich')); Response::redirect('admin/settings'); } else { Session::set_flash('error', e('Bearbeitung NICHT erfolgreich')); } } $data['client'] = $client; $this->template->title = "Einstellungen"; $this->template->content = View::forge('admin/settings/edit', $data); } }