Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
UserAdminV2
Overview
Overview
Details
Activity
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
庄欣
UserAdminV2
Commits
f6ea2676
Commit
f6ea2676
authored
Jun 15, 2011
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added Input::filled, Input::had, and Input::was_filled.
parent
92939a8a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
11 deletions
+58
-11
system/input.php
+58
-11
No files found.
system/input.php
View file @
f6ea2676
...
...
@@ -10,14 +10,39 @@ class Input {
public
static
$input
;
/**
* Determine if the input data contains an item.
* Determine if the input data contains an item or set of items.
*
* @return bool
*/
public
static
function
has
()
{
foreach
(
func_get_args
()
as
$key
)
{
if
(
is_null
(
static
::
get
(
$key
)))
{
return
false
;
}
}
return
true
;
}
/**
* Determine if the input data contains an item or set of items that are not empty.
*
* @param string $key
* @return bool
*/
public
static
function
has
(
$key
)
public
static
function
filled
(
)
{
return
(
!
is_null
(
static
::
get
(
$key
)));
foreach
(
func_get_args
()
as
$key
)
{
if
(
!
static
::
has
(
$key
)
or
trim
((
string
)
static
::
get
(
$key
))
==
''
)
{
return
false
;
}
}
return
true
;
}
/**
...
...
@@ -29,9 +54,6 @@ class Input {
*/
public
static
function
get
(
$key
=
null
,
$default
=
null
)
{
// -----------------------------------------------------
// Has the input data been hydrated for the request?
// -----------------------------------------------------
if
(
is_null
(
static
::
$input
))
{
static
::
hydrate
();
...
...
@@ -41,14 +63,39 @@ class Input {
}
/**
* Determine if the old input data contains an item.
* Determine if the old input data contains an item or set of items.
*
* @return bool
*/
public
static
function
had
()
{
foreach
(
func_get_args
()
as
$key
)
{
if
(
is_null
(
static
::
old
(
$key
)))
{
return
false
;
}
}
return
true
;
}
/**
* Determine if the old input data contains an item or set of items that are not empty.
*
* @param string $key
* @return bool
*/
public
static
function
has_old
(
$key
)
public
static
function
was_filled
(
)
{
return
(
!
is_null
(
static
::
old
(
$key
)));
foreach
(
func_get_args
()
as
$key
)
{
if
(
!
static
::
had
(
$key
)
or
trim
((
string
)
static
::
old
(
$key
))
==
''
)
{
return
false
;
}
}
return
true
;
}
/**
...
...
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