PHP code example of joel-depiltech / codeigniter-holidayapi

1. Go to this page and download the library: Download joel-depiltech/codeigniter-holidayapi 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/ */

    

joel-depiltech / codeigniter-holidayapi example snippets


$config['composer_autoload'] = TRUE; // or a custom path as 'vendor/autoload.php'

$this->load->add_package_path(APPPATH . 'third_party/holidayapi');

$this->load->library('HolidayAPI');

$config['holidayapi_test_api_key'] = '058f4506-caf0-4bdd-b52b-cbc98e20e02e';
$config['holidayapi_live_api_key'] = '*** Fill in your own Live API key ***';


$this->load->library('HolidayAPI');
$holidays = $this->holidayapi->holidays();
print_r($holidays);


$this->load->library('HolidayAPI', array('holidayapi_live_api_key' => '** An other API key **'));
$holidays = $this->holidayapi->holidays('FR', 2018, 12, 25, FALSE, TRUE);
print_r($holidays);