PHP Class phprs\Container

Author: caoym
Show file Open project: caoym/phprs-restful

Public Properties

Property Type Description
$class API 实现类;
$factory
$path
$routes private $injectors=array();

Public Methods

Method Description
__construct ( string $class, string $method = null )
getImpl ( Request $request ) : object 获取API实现类的实例
getInjected ( ) : array 获取实例被注入的方法 只有实例被创建后才能取到值
load ( string $class, string $method )

Method Details

__construct() public method

public __construct ( string $class, string $method = null )
$class string 类名
$method string 方法名, 如果为空, 则加载此类的所有方法

getImpl() public method

获取API实现类的实例
public getImpl ( Request $request ) : object
$request Request
return object

getInjected() public method

获取实例被注入的方法 只有实例被创建后才能取到值
public getInjected ( ) : array
return array

load() public method

public load ( string $class, string $method )
$class string 类名
$method string ==null时load所有方法, !==null时load指定方法

Property Details

$class public property

API 实现类;
public $class

$factory public property

public $factory

$path public property

public $path

$routes public property

private $injectors=array();
public $routes