Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Amended Request doc #11949

Merged
merged 1 commit into from
Jul 3, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 20 additions & 12 deletions phalcon/http/request.zep
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,20 @@ use Phalcon\Di\InjectionAwareInterface;
* It packages the HTTP request environment.
*
*<code>
* $request = new \Phalcon\Http\Request();
* if ($request->isPost() == true) {
* if ($request->isAjax() == true) {
* echo 'Request was made using POST and AJAX';
* }
* }
* use Phalcon\Http\Request;
*
* $request = new Request();
*
* if ($request->isPost()) {
* if ($request->isAjax()) {
* echo 'Request was made using POST and AJAX';
* }
* }
*
* $request->getServer('HTTP_HOST'); // retrieve SERVER variables
* $request->getMethod(); // GET, POST, PUT, DELETE, HEAD, OPTIONS, PATCH, PURGE, TRACE, CONNECT
* $request->getLanguages(); // an array of languages the client accepts
*
*</code>
*
*/
Expand Down Expand Up @@ -140,14 +148,14 @@ class Request implements RequestInterface, InjectionAwareInterface
* If no parameters are given the $_GET superglobal is returned
*
*<code>
* //Returns value from $_GET["id"] without sanitizing
* $id = $request->getQuery("id");
* // Returns value from $_GET['id'] without sanitizing
* $id = $request->getQuery('id');
*
* //Returns value from $_GET["id"] with sanitizing
* $id = $request->getQuery("id", "int");
* // Returns value from $_GET['id'] with sanitizing
* $id = $request->getQuery('id', 'int');
*
* //Returns value from $_GET["id"] with a default value
* $id = $request->getQuery("id", null, 150);
* // Returns value from $_GET['id'] with a default value
* $id = $request->getQuery('id', null, 150);
*</code>
*/
public function getQuery(string! name = null, var filters = null, var defaultValue = null, boolean notAllowEmpty = false, boolean noRecursive = false) -> var
Expand Down