<?php
require 'App.php';
/*
* declaring an class for later using as alias
* */
class myClass extends PDO {}
frdl\webfan\App::God(false, "Demo", null, false)
/*
* predefined when init===true
*/
-> addShortCut('$', array(frdl\webfan\App::God(),'addShortCut'))
/*
* Using Shortcut https://github.com/frdl/webfan/wiki/Lambada-Overloading-Syntax
*/
-> {'$'}('!write', (function($arg){$a = func_get_args(); echo $a[0];}) )
->{'$'}('lnbr', (function(){echo '<br />'."\r\n";}) )
/*
* Using Aliasing https://github.com/frdl/webfan/wiki/Aliasing
*/
-> setAlias('DB Wrapper', '\myDB', '\myClass', '\PDO',array())
-> mapAliasing(false)
-> applyAliasMap(true)
-> lnbr()
;
frdl\webfan\App::God()
-> lnbr()
->{'$'}('showexamplecode', (function(){echo highlight_file(__FILE__, true);}) )
-> showexamplecode()
-> lnbr()
-> {'!write'}('Outputs: ')
-> {'!write'}('Hello world')
-> {'!write'}(' - and your PDO drivers')
-> lnbr()
;
echo print_r(\myDB::getAvailableDrivers(), true);
?>
|