PHP code example of virdiggg / header-ci3

1. Go to this page and download the library: Download virdiggg/header-ci3 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/ */

    

virdiggg / header-ci3 example snippets


 defined('BASEPATH') or exit('No direct script access allowed');

use Virdiggg\HeaderCi3\Headers;

class App extends CI_Controller
{
	private $headers;
	public function __construct()
	{
		parent::__construct();
	}

	public function testing1()
	{
		$this->headers = new Headers();
		$this->headers->setHeaders();
		return;
	}

	public function testing2()
	{
		$this->headers = new Headers();
		$this->headers->setContentSecurityPolicy(["default-src 'self'"]);
		$this->headers->setHeaders();
		echo 1;
		return;
	}

	public function testing3()
	{
		$this->headers = new Headers();
		$this->headers->setXDNSPrefetchControl('on');
		$this->headers->setHeaders();
		echo 1;
		return;
	}

	public function test_header()
	{
		$this->headers = new Headers();
		echo 1;
		return;
	}

	public function test_no_header()
	{
		echo 1;
		return;
	}
}

$this->headers = new Headers();
$this->headers->setHeaders();

$this->headers = new Headers();
$this->headers->setContentSecurityPolicy([array]);
$this->headers->setHeaders();

$this->headers = new Headers();
$this->headers->setCrossOriginOpenerPolicy('string');
$this->headers->setHeaders();

$this->headers = new Headers();
$this->headers->setCrossOriginResourcePolicy('string');
$this->headers->setHeaders();

$this->headers = new Headers();
$this->headers->setCrossOriginResourcePolicy('string');
$this->headers->setHeaders();

$this->headers = new Headers();
$this->headers->setOriginAgentCluster('string');
$this->headers->setHeaders();

$this->headers = new Headers();
$this->headers->setReferrerPolicy('string');
$this->headers->setHeaders();

$this->headers = new Headers();
$this->headers->setStrictTransportSecurity('string');
$this->headers->setHeaders();

$this->headers = new Headers();
$this->headers->setXContentTypeOptions('string');
$this->headers->setHeaders();

$this->headers = new Headers();
$this->headers->setXDNSPrefetchControl('string');
$this->headers->setHeaders();

$this->headers = new Headers();
$this->headers->setXDownloadOptions('string');
$this->headers->setHeaders();

$this->headers = new Headers();
$this->headers->setXFrameOptions('string');
$this->headers->setHeaders();

$this->headers = new Headers();
$this->headers->setXPermittedCrossDomainPolicies('string');
$this->headers->setHeaders();

$this->headers = new Headers();
$this->headers->setXXSSProtection('string');
$this->headers->setHeaders();

$this->headers = new Headers();
$this->headers->setPermissionPolicy('string');
$this->headers->setHeaders();