コード例 #1
0
 public function post_page()
 {
     $contents = Input::all();
     Page::setPages($contents);
     return Redirect::to('admin/modul/page');
     Log::write('Module', 'Modify Page Information by ' . Auth::user()->username);
 }
コード例 #2
0
ファイル: api.php プロジェクト: SerdarSanri/RestServiceApi
 public static function parameters_check($rules = null)
 {
     $request = \Laravel\Input::all();
     if (is_array($rules)) {
         $validation = Validator::make($request, $rules);
         if ($validation->fails()) {
             $error = $validation->errors->first();
             return $error;
         } else {
             return $request;
         }
     } else {
         return $request;
     }
 }
コード例 #3
0
ファイル: html.php プロジェクト: reith2004/components
 public static function sort_link($url, $sort_by, $name)
 {
     return HTML::link($url . '?' . http_build_query(array_merge(Input::all(), array('sort_by' => $sort_by, 'order' => Input::get('sort_by') == $sort_by ? Input::get('order') == 'ASC' ? 'DESC' : 'ASC' : 'ASC'))), $name);
 }
コード例 #4
0
ファイル: form.php プロジェクト: reith2004/components
 /**
  * Saves input from the $input parameter (array) into the form model's
  * field_data array if the key is present in the $fields array then 
  * serializes the field_data array to the session.
  * 
  * The $fields array is a simple array. Only the fields declared in 
  * the $field array will be stored.
  *
  * <code>
  *		// save form input data
  *		ExampleForm::save_input( array( 'first_name', 'last_name' ) );
  * </code>
  *
  * @param  array   $fields
  * @param  array   $input
  */
 public static function save_input($fields = null, $input = null)
 {
     // $fields must be an array
     if (!is_array($fields) && !is_null($fields)) {
         return false;
     }
     // by default we save all fields
     if (is_null($fields)) {
         $fields = array_keys(Input::all());
     }
     // by default we save all input, this can be overridden by passing
     // a second parameter to the save_input() method
     if (is_null($input)) {
         $input = Input::all();
     }
     // when storing input it's important to load the persistent form
     // data that may exist from previous requests, otherwise we will
     // overwrite them
     if (empty(static::$field_data)) {
         static::unserialize_from_session();
     }
     // ideally we'll have either a value for a field or an empty value
     // for a field. this isn't strictly necessary and may change in the
     // future given an appropriately convincing argument
     foreach ($fields as $field_name) {
         if (Input::has($field_name)) {
             static::$field_data[$field_name] = Input::get($field_name);
         } else {
             static::$field_data[$field_name] = '';
         }
     }
     // serialize the field data to session
     static::serialize_to_session();
 }
コード例 #5
0
ファイル: validator.php プロジェクト: juaniiie/mwi
 public function validate_test_db_connection()
 {
     $this->adm_lang = Session::get('adm_lang');
     $this->messages['test_db_connection'] = __('install::lang.Unable to connect to database')->get($this->adm_lang);
     return Installer::test_db_connection(Input::all());
 }