PHP code example of lordmonoxide / facade

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

    

lordmonoxide / facade example snippets


namespace Vendor\Package\Logging;

class Logger {
  public function warning($text) {
    // ...
  }
}

$logger = new Vendor\Package\Logging\Logger;

$phi = LordMonoxide\Phi\Phi::instance();
$phi->bind('core.log', $logger);

use LordMonoxide\Facade\Facade;

class Log extends Facade {
  protected static $_binding = 'core.log';
}

Log::warning('Something bad happened!');

$phi = LordMonoxide\Phi\Phi::instance();
$phi->bind('phi', $phi);

use LordMonoxide\Facade\Facade;

class Phi extends Facade {
  protected static $_binding = 'phi';
}

Phi::bind('Bar', 'Foo');
$foo = Phi::make('Bar');