allow message container to be passed into redirect->with_errors.
This commit is contained in:
parent
cb306c9091
commit
92ff0474a1
|
@ -98,14 +98,19 @@ public function with_input($filter = null, $items = array())
|
|||
* <code>
|
||||
* // Redirect and flash a validator's errors the session
|
||||
* return Redirect::to('register')->with_errors($validator);
|
||||
*
|
||||
* // Redirect and flash a message container to the session
|
||||
* return Redirect::to('register')->with_errors($messages);
|
||||
* </code>
|
||||
*
|
||||
* @param Validator $validator
|
||||
* @param Validator|Messages $container
|
||||
* @return Redirect
|
||||
*/
|
||||
public function with_errors(Validator $validator)
|
||||
public function with_errors($container)
|
||||
{
|
||||
return $this->with('errors', $validator->errors);
|
||||
$errors = ($container instanceof Validator) ? $container->errors : $container;
|
||||
|
||||
return $this->with('errors', $errors);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue