diff --git a/application/config/error.php b/application/config/error.php index 017f1720..d5886eac 100644 --- a/application/config/error.php +++ b/application/config/error.php @@ -52,6 +52,11 @@ return array( 'handler' => function($exception, $severity, $message, $config) { + if ($config['log']) + { + call_user_func($config['logger'], $severity, $message); + } + if ($config['detail']) { $data = compact('exception', 'severity', 'message'); @@ -63,11 +68,6 @@ return array( $response = Response::error('500'); } - if ($config['log']) - { - call_user_func($config['logger'], $severity, $message); - } - $response->send(); exit(1); diff --git a/laravel/form.php b/laravel/form.php index 5cc723c1..0b16f9f1 100644 --- a/laravel/form.php +++ b/laravel/form.php @@ -15,9 +15,25 @@ class Form { /** * Open a HTML form. * - * Note: If PUT or DELETE is specified as the form method, a hidden input field will be generated - * containing the request method. PUT and DELETE are not supported by HTML forms, so the - * hidden field will allow us to "spoof" PUT and DELETE requests. + * If PUT or DELETE is specified as the form method, a hidden input field will be generated + * containing the request method. PUT and DELETE are not supported by HTML forms, so the + * hidden field will allow us to "spoof" PUT and DELETE requests. + * + * Unless specified, the "accept-charset" attribute will be set to the application encoding. + * + * + * // Open a "POST" form to the current request URI + * echo Form::open(); + * + * // Open a "POST" form to a given URI + * echo Form::open('user/profile'); + * + * // Open a "PUT" form to a given URI + * echo Form::open('user/profile', 'put'); + * + * // Open a form that has HTML attributes + * echo Form::open('user/profile', 'post', array('class' => 'profile')); + * * * @param string $action * @param string $method @@ -149,6 +165,11 @@ class Form { /** * Create a HTML label element. * + * + * // Create a label for the "email" input element + * echo Form::label('email', 'E-Mail Address'); + * + * * @param string $name * @param string $value * @param array $attributes @@ -167,6 +188,14 @@ class Form { * If an ID attribute is not specified and a label has been generated matching the input * element name, the label name will be used as the element ID. * + * + * // Create a "text" input element named "email" + * echo Form::input('text', 'email'); + * + * // Create an input element with a specified default value + * echo Form::input('text', 'email', 'example@gmail.com'); + * + * * @param string $name * @param mixed $value * @param array $attributes @@ -318,6 +347,14 @@ class Form { /** * Create a HTML select element. * + * + * // Create a HTML select element filled with options + * echo Form::select('sizes', array('S' => 'Small', 'L' => 'Large')); + * + * // Create a select element with a default selected value + * echo Form::select('sizes', array('S' => 'Small', 'L' => 'Large'), 'L'); + * + * * @param string $name * @param array $options * @param string $selected @@ -343,6 +380,14 @@ class Form { /** * Create a HTML checkbox input element. * + * + * // Create a checkbox element + * echo Form::checkbox('terms', 'yes'); + * + * // Create a checkbox that is selected by default + * echo Form::checkbox('terms', 'yes', true); + * + * * @param string $name * @param string $value * @param bool $checked @@ -357,6 +402,14 @@ class Form { /** * Create a HTML radio button input element. * + * + * // Create a radio button element + * echo Form::radio('drinks', 'Milk'); + * + * // Create a radio button that is selected by default + * echo Form::radio('drinks', 'Milk', true); + * + * * @param string $name * @param string $value * @param bool $checked @@ -414,6 +467,13 @@ class Form { /** * Create a HTML image input element. * + * The URL::to_asset method will be called on the given URL. + * + * + * // Create an image input element + * echo Form::image('img/submit.png'); + * + * * @param string $url * @param array $attributes * @return string