Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

flextype-components/http

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Http Component

version MIT License

Simple Http Component to work with Http request, response and urls.

Installation

composer require flextype-components/http

Usage

Set header status

Http::setResponseStatus(404);

Redirects the browser to a page specified by the url argument.

Http::redirect('http://flextype.org');

Set one or multiple request headers.

Http::setRequestHeaders('Location: http://flextype.org');

Get

$action = Http::get('action');

Post

$username = Http::post('username');

Returns whether this is an ajax request or not

if (Http::isAjaxRequest()) {
  // do something...
}

Terminate request

Http::requestShutdown();

Gets the base URL

echo Http::getBaseUrl();

Gets current URL

echo Http::getCurrentUrl();

Get Uri String

$uri_string = Http::getUriString();

Get Uri Segments

$uri_segments = Http::getUriSegments();

Get Uri Segment

$uri_segment = Http::getUriSegment(1);

License

See LICENSE

About

Simple Http Component to work with Http request, response and urls.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.