PHP code example of thapp / iocconf

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

    

thapp / iocconf example snippets


  // ...
  'Thapp\IocConf\IocConfServiceProvider' 
  // ...

return array(

    /*
    |--------------------------------------------------------------------------
    | Basedir relative to the install directory
    |--------------------------------------------------------------------------
     */
    'basedir' => array(
        'ioc'      => 'vendor/thapp/iocconf/src/Thapp/IocConf'
    ),

    /*
    |--------------------------------------------------------------------------
    | Reader dictionary
    |--------------------------------------------------------------------------
     */
    'namespaces' => array(
        'ioc'      => 'Thapp\\IocConf'
    ),
);






namespace Acme;

use \BaseController;

class FrontController extends BaseController
{

    // ... setter method on your controller
    public function setView(\Illuminate\View\Environment $view)
    {
        $this->view = $view;
    }

}   


$repo = App::make('ControllerRepository');

$repo2 = App::make('ControllerRepository');

$repo === $repo2 // true