update folder location

This commit is contained in:
Antonio Ramirez
2017-01-11 21:31:42 +01:00
parent 1cb60f0740
commit 13255a5117
167 changed files with 4770 additions and 8 deletions

View File

@ -0,0 +1,64 @@
<?php
/*
* This file is part of the 2amigos/yii2-usuario project.
*
* (c) 2amigOS! <http://2amigos.us/>
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Da\User\Traits;
use Da\User\Helper\AuthHelper;
use Da\User\Helper\ClassMapHelper;
use Yii;
use yii\di\Container;
/**
* @property-read Container $di
* @property-ready Da\User\Helper\AuthHelper $auth
* @property-ready Da\User\Helper\ClassMapHelper $classMap
*/
trait ContainerAwareTrait
{
/**
* @return Container
*/
public function getDi()
{
return Yii::$container;
}
/**
* Gets a class from the container.
*
* @param string $class he class name or an alias name (e.g. `foo`) that was previously registered via [[set()]]
* or [[setSingleton()]]
* @param array $params constructor parameters
* @param array $config attributes
*
* @return object
*/
public function make($class, $params = [], $config = [])
{
return $this->getDi()->get($class, $params, $config);
}
/**
* @return \Da\User\Helper\AuthHelper
*/
public function getAuth()
{
return $this->getDi()->get(AuthHelper::class);
}
/**
* @return \Da\User\Helper\ClassMapHelper
*/
public function getClassMap()
{
return $this->getDi()->get(ClassMapHelper::class);
}
}