PHP code example of azine / geoblocking-bundle

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

    

azine / geoblocking-bundle example snippets


php composer.phar update



// in AppKernel::registerBundles()
$bundles = array(
    // ...
   	new Azine\GeoBlockingBundle\AzineGeoBlockingBundle(),
    // ...
);

// src/Acme/YourBundle/Controller/InvitationController.php
...
    public function handleClickOnInvitationLinkAction(Request $request){
        ...
        // do your magic here 
        ...
        
        // render the view welcoming the invited user
        $response = $this->container->get('templating')->renderResponse('AcmeYourBundle:Invitation:welcomeInvitedUser.html.twig.');
        
        // set the geoblocking_allow_cookie, so the invited user can take a look arround before registering.
        $response->headers->setCookie(new Cookie("geoblocking_allow_cookie", true, new \DateTime("2 days")));
        return $response;
    }