PHP code example of germania-kg / uuidserviceprovider

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

    

germania-kg / uuidserviceprovider example snippets



use Germania\UuidServiceProvider\UuidServiceProvider;

// A. Use with Slim or Pimple
$app = new \Slim\App;
$dic = $app->getContainer();
$dic = new Pimple\Container;

// B. Register Service Provider.
$dic->register( new UuidServiceProvider  );


$uuid4 = $dic['UUID.new'];


$uuid4_hex = $dic['UUID.new.hex'];


$factory = $dic['UUID.Factory'];
$uuid4 = $factory();


$factory = $dic['UUID.HexFactory'];
$uuid4_hex = $factory();