PHP Classes
elePHPant
Icontem

File: src/Utils/Traits/DI.php

Recommend this page to a friend!
  Classes of Thierry Feuzeu  >  Jaxon  >  src/Utils/Traits/DI.php  >  Download  
File: src/Utils/Traits/DI.php
Role: Class source
Content type: text/plain
Description: Class source
Class: Jaxon
Call PHP classes from JavaScript using AJAX
Author: By
Last change:
Date: 5 months ago
Size: 761 bytes
 

 

Contents

Class file image Download
<?php

/**
 * DI.php - Trait for dependency injection
 *
 * Define closures for instanciating classes, and return class instances.
 *
 * @package jaxon-core
 * @author Thierry Feuzeu <thierry.feuzeu@gmail.com>
 * @copyright 2016 Thierry Feuzeu <thierry.feuzeu@gmail.com>
 * @license https://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
 * @link https://github.com/jaxon-php/jaxon-core
 */

namespace Jaxon\Utils\Traits;

use
Jaxon\DI\Container;

trait
DI
{
   
/**
     * Get a class instance
     *
     * @param string $sClass A full class name
     *
     * @return object The class instance
     */
   
public function diGet($sClass)
    {
        return
Container::getInstance()->get($sClass);
    }
}