PHP code example of flextype-components / http

1. Go to this page and download the library: Download flextype-components/http library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

flextype-components / http example snippets


Http::setResponseStatus(404);

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

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

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

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

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

Http::requestShutdown();

echo Http::getBaseUrl();

echo Http::getCurrentUrl();

$uri_string = Http::getUriString();

$uri_segments = Http::getUriSegments();

$uri_segment = Http::getUriSegment(1);