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
c18dcecb
Commit
c18dcecb
authored
Mar 21, 2012
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #420 from kyledecot/develop
Form::register
parents
43212f85
95ba416f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
0 deletions
+35
-0
form.php
laravel/form.php
+35
-0
No files found.
laravel/form.php
View file @
c18dcecb
...
...
@@ -9,6 +9,28 @@ class Form {
*/
protected
static
$labels
=
array
();
/**
* The registered custom inputs
*
* @var array
*/
protected
static
$inputs
=
array
();
/**
* Dynamically handle calls to custom registered inputs.
*/
public
static
function
__callStatic
(
$method
,
$parameters
)
{
if
(
isset
(
static
::
$inputs
[
$method
]))
{
return
call_user_func_array
(
static
::
$inputs
[
$method
],
$parameters
);
}
throw
new
\Exception
(
"Method [
$method
] does not exist."
);
}
/**
* Open a HTML form.
*
...
...
@@ -62,6 +84,19 @@ class Form {
return
'<form'
.
HTML
::
attributes
(
$attributes
)
.
'>'
.
$append
.
PHP_EOL
;
}
/**
* Registers a custom input
*
* @param string $name
* @param Closure $input
* @return void
*/
public
static
function
register
(
$name
,
$input
)
{
static
::
$inputs
[
$name
]
=
$input
;
}
/**
* Determine the appropriate request method to use for a form.
*
...
...
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