Introducing IO4/Webfat Facades

Import shortcuts and facades into ANY namespace

You can now import the facades into ANY namespace.

So this works:

  <?php

namespace MyNamespace1;

  echo   Helper::toUUID4() ; 
    echo '-'; 
    echo Config::get('appId');    

…and this works also…:

  <?php

namespace MyOtherNamespace2;

  echo   Helper::toUUID4() ; 
    echo '-'; 
    echo Config::get('appId');    

The snippet from container-entry “script@inc.common.bootstrap” does it and it now looks like

<?php

if($container->has('config.IO4_FACADES_ENABLE') && true === $container->get('config.IO4_FACADES_ENABLE')
     && $container->has('config.app.core.code.facades.$import')
    ){
      $import = $container->get('config.app.core.code.facades.$import');
      $container->get('app.runtime.stubrunner')->withFacades(
           $import['baseName'],           
           $import['namespace']          
      );
 } 

It uses the “statical library”.

connect with ❤️Webfan | connect with Google