public function postIndex() { //dd(Input::all()); // Load settings //$settings = new Setting(); //$settings = $settings->getSettings(); //$data = File::get(storage_path().'/settings.json'); //dd($data); // HTML $status = Input::get('status'); $color = Input::get('color'); // Designs $design_names = Input::get('designs'); $designs = array(); foreach ($design_names as $name) { $designs[$name] = array('status' => $status[$name], 'color' => $color[$name]); } // Components $components_names = Input::get('components'); $components = array(); foreach ($components_names as $name) { $components[$name] = array('status' => $status[$name], 'color' => $color[$name]); } $data = array('designs' => $designs, 'components' => $components); //dd(storage_path().'/settings.json'); //File::put(storage_path().'/settings.json', json_encode($data)); $settings = new Setting(); $settings->save($data); $components = load_components(); $designs = load_designs(); $message = 'Settings saved.'; return View::make('boots::admin', compact('components', 'designs', 'message')); }
<?php /** ------------------------------------------------------------ * Name: index.php * Author: James Archuleta, IRM-CAS, LANL * Date: Apr 13, 2012 * Description: Lightweight router/dispatcher loader written to replace cakephp * for use on lower environments where cakephp doesn't work *-------------------------------------------------------------*/ //define APP_ROOT define('APP_ROOT', dirname($_SERVER['SCRIPT_FILENAME'])); // //Automatically load components // load_components(); // //--- Router/dispatcher --------------------------------------------------------- // // GET the Request and build out controller $requestURI = explode('/', $_SERVER['REQUEST_URI']); $scriptName = explode('/', $_SERVER['SCRIPT_NAME']); for ($i = 0; $i < sizeof($scriptName); $i++) { if ($requestURI[$i] == $scriptName[$i]) { unset($requestURI[$i]); } } //parse out url data $command = array_values($requestURI); $controller = 'app'; // Change this line to change the default controller name if (count($command) >= 1) {