PHP code example of oranfry / registers

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

    

oranfry / registers example snippets


use Registers\Register;

Register::register('wozzle', [
    'big' => \Acme\Wozzles\Big::class,
    'small' => \Acme\Wozzles\Small::class,
]);

use Registers\Register;

Register::::load('wozzle', 'big');

$wozzle->fizzle();

if (Register::::available('wozzle', 'medium')) {
    Register::::load('wozzle', 'medium')->wiggle();
}

echo "All available wozzles:<br><pre>\n";
var_dump(Register::::available('wozzle'));
echo "</pre>";