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
9e8acd1e
Commit
9e8acd1e
authored
Mar 29, 2012
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix some input stuff and revert paginator changes.
parent
77fe8b67
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
4 deletions
+33
-4
input.php
laravel/input.php
+32
-3
paginator.php
laravel/paginator.php
+1
-1
No files found.
laravel/input.php
View file @
9e8acd1e
...
...
@@ -16,7 +16,7 @@ class Input {
*/
public
static
function
all
()
{
$input
=
array_merge
(
static
::
get
(),
static
::
query
(),
$_FILES
);
$input
=
array_merge
(
static
::
get
(),
static
::
query
(),
static
::
file
()
);
unset
(
$input
[
Request
::
spoofer
]);
...
...
@@ -55,7 +55,14 @@ class Input {
*/
public
static
function
get
(
$key
=
null
,
$default
=
null
)
{
return
array_get
(
Request
::
foundation
()
->
request
->
all
(),
$key
,
$default
);
$value
=
Request
::
foundation
()
->
request
->
get
(
$key
);
if
(
is_null
(
$value
))
{
return
array_get
(
static
::
query
(),
$key
,
$default
);
}
return
$value
;
}
/**
...
...
@@ -161,7 +168,29 @@ class Input {
*/
public
static
function
file
(
$key
=
null
,
$default
=
null
)
{
return
array_get
(
Request
::
foundation
()
->
files
->
all
(),
$key
,
$default
);
return
array_get
(
$_FILES
,
$key
,
$default
);
}
/**
* Move an uploaded file to permanent storage.
*
* This method is simply a convenient wrapper around move_uploaded_file.
*
* <code>
* // Move the "picture" file to a new permanent location on disk
* Input::upload('picture', 'path/to/photos', 'picture.jpg');
* </code>
*
* @param string $key
* @param string $directory
* @param string $name
* @return bool
*/
public
static
function
upload
(
$key
,
$directory
,
$name
=
null
)
{
if
(
is_null
(
static
::
file
(
$key
)))
return
false
;
return
Request
::
foundation
()
->
files
->
get
(
$key
)
->
move
(
$directory
,
$name
);
}
/**
...
...
laravel/paginator.php
View file @
9e8acd1e
...
...
@@ -112,7 +112,7 @@ class Paginator {
*/
public
static
function
page
(
$total
,
$per_page
)
{
$page
=
Input
::
query
(
'page'
,
1
);
$page
=
Input
::
get
(
'page'
,
1
);
// The page will be validated and adjusted if it is less than one or greater
// than the last page. For example, if the current page is not an integer or
...
...
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