PHP code example of cable / cable-cookie

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

    

cable / cable-cookie example snippets

 
$container = \Cable\Container\Factory::create();
$container->add('request', \Symfony\Component\HttpFoundation\Request::createFromGlobals());

$container->addProvider(\Cable\Cookie\CookieServiceProvider::class);
$container->singleton('response', \Symfony\Component\HttpFoundation\Response::create());
$cookie = $container['cookie'];

var_dump($cookie);


 

$container = \Cable\Container\Factory::create();

$container->addProvider(\Cable\Session\SessionServiceProvider::class);
$container->singleton('response', \Symfony\Component\HttpFoundation\Response::create());
$session = $container['session'];

$flash = $container['flashbag'];