Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
syncEnrollments
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Yeray Santana Hualde
syncEnrollments
Commits
122dff97
Commit
122dff97
authored
Sep 22, 2011
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added comments to form class.
parent
766fa983
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
8 deletions
+68
-8
error.php
application/config/error.php
+5
-5
form.php
laravel/form.php
+63
-3
No files found.
application/config/error.php
View file @
122dff97
...
@@ -52,6 +52,11 @@ return array(
...
@@ -52,6 +52,11 @@ return array(
'handler'
=>
function
(
$exception
,
$severity
,
$message
,
$config
)
'handler'
=>
function
(
$exception
,
$severity
,
$message
,
$config
)
{
{
if
(
$config
[
'log'
])
{
call_user_func
(
$config
[
'logger'
],
$severity
,
$message
);
}
if
(
$config
[
'detail'
])
if
(
$config
[
'detail'
])
{
{
$data
=
compact
(
'exception'
,
'severity'
,
'message'
);
$data
=
compact
(
'exception'
,
'severity'
,
'message'
);
...
@@ -63,11 +68,6 @@ return array(
...
@@ -63,11 +68,6 @@ return array(
$response
=
Response
::
error
(
'500'
);
$response
=
Response
::
error
(
'500'
);
}
}
if
(
$config
[
'log'
])
{
call_user_func
(
$config
[
'logger'
],
$severity
,
$message
);
}
$response
->
send
();
$response
->
send
();
exit
(
1
);
exit
(
1
);
...
...
laravel/form.php
View file @
122dff97
...
@@ -15,10 +15,26 @@ class Form {
...
@@ -15,10 +15,26 @@ class Form {
/**
/**
* Open a HTML form.
* Open a HTML form.
*
*
*
Note:
If PUT or DELETE is specified as the form method, a hidden input field will be generated
* 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
* 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.
* hidden field will allow us to "spoof" PUT and DELETE requests.
*
*
* Unless specified, the "accept-charset" attribute will be set to the application encoding.
*
* <code>
* // 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'));
* </code>
*
* @param string $action
* @param string $action
* @param string $method
* @param string $method
* @param array $attributes
* @param array $attributes
...
@@ -149,6 +165,11 @@ class Form {
...
@@ -149,6 +165,11 @@ class Form {
/**
/**
* Create a HTML label element.
* Create a HTML label element.
*
*
* <code>
* // Create a label for the "email" input element
* echo Form::label('email', 'E-Mail Address');
* </code>
*
* @param string $name
* @param string $name
* @param string $value
* @param string $value
* @param array $attributes
* @param array $attributes
...
@@ -167,6 +188,14 @@ class Form {
...
@@ -167,6 +188,14 @@ class Form {
* If an ID attribute is not specified and a label has been generated matching the input
* 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.
* element name, the label name will be used as the element ID.
*
*
* <code>
* // 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');
* </code>
*
* @param string $name
* @param string $name
* @param mixed $value
* @param mixed $value
* @param array $attributes
* @param array $attributes
...
@@ -318,6 +347,14 @@ class Form {
...
@@ -318,6 +347,14 @@ class Form {
/**
/**
* Create a HTML select element.
* Create a HTML select element.
*
*
* <code>
* // 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');
* </code>
*
* @param string $name
* @param string $name
* @param array $options
* @param array $options
* @param string $selected
* @param string $selected
...
@@ -343,6 +380,14 @@ class Form {
...
@@ -343,6 +380,14 @@ class Form {
/**
/**
* Create a HTML checkbox input element.
* Create a HTML checkbox input element.
*
*
* <code>
* // Create a checkbox element
* echo Form::checkbox('terms', 'yes');
*
* // Create a checkbox that is selected by default
* echo Form::checkbox('terms', 'yes', true);
* </code>
*
* @param string $name
* @param string $name
* @param string $value
* @param string $value
* @param bool $checked
* @param bool $checked
...
@@ -357,6 +402,14 @@ class Form {
...
@@ -357,6 +402,14 @@ class Form {
/**
/**
* Create a HTML radio button input element.
* Create a HTML radio button input element.
*
*
* <code>
* // 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);
* </code>
*
* @param string $name
* @param string $name
* @param string $value
* @param string $value
* @param bool $checked
* @param bool $checked
...
@@ -414,6 +467,13 @@ class Form {
...
@@ -414,6 +467,13 @@ class Form {
/**
/**
* Create a HTML image input element.
* Create a HTML image input element.
*
*
* The URL::to_asset method will be called on the given URL.
*
* <code>
* // Create an image input element
* echo Form::image('img/submit.png');
* </code>
*
* @param string $url
* @param string $url
* @param array $attributes
* @param array $attributes
* @return string
* @return string
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment