PHP code example of bozworks / bouncer.php

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

    

bozworks / bouncer.php example snippets



  use Boz\Bouncer as Bouncer;
  //Load Composer's autoloader
  


  oz\Bouncer as Bouncer;
  new Bouncer();


  oz\Bouncer as Bouncer;
  
  $bouncer = new Bouncer(array(
    'useremail' => '[email protected]',
    'password' => '12345',
    'expiry' => '3 day'
  ));
  
  $bouncer
  ->name('useremail')
  ->true);
  
  if($bouncer->get('valid') === 1) {
    openSession(
      $bouncer->get('value', 'useremail'),
      $bouncer->get('value', 'expiry')
    );
    echo '<div role="alert" class="msg success">Successfully Logged In</div>';
  } else {
    foreach($bouncer->get('errors') as $field => $errors) {
      foreach ($errors as $rule => $error) {
        echo '<div role="alert" class="msg error">' . $error . '</div>';
      }
    }
  }
shell
composer