PHP code example of medelse / referer-cookie-bundle

1. Go to this page and download the library: Download medelse/referer-cookie-bundle 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/ */

    

medelse / referer-cookie-bundle example snippets

 php
// app/AppKernel.php

public function registerBundles()
{
    return array(
        // ...
        new Medelse\RefererCookieBundle\MedelseRefererCookieBundle(),
    );
}
 php
// config/bundles.php

return [
    // ...
    Medelse\RefererCookieBundle\MedelseRefererCookieBundle::class => ['all' => true],
];
 php
$this->get('medelse_referer_cookie.referer_cookie')->init(); // just init - read referer params and cookie and save new values. (optionnal if auto_init config is TRUE or automatically called when call get() method)
$this->get('medelse_referer_cookie.referer_cookie')->get(); // get all cookies as array
$this->get('medelse_referer_cookie.referer_cookie')->get('internal'); // get referer_internal (can use 'internal' or 'external')
$this->get('medelse_referer_cookie.referer_cookie')->get('source'); // get referer_internal