added facades and made other ioc improvements.

This commit is contained in:
Taylor Otwell
2011-08-30 22:09:47 -05:00
parent 501953f2db
commit 0ef96fb8d0
27 changed files with 271 additions and 276 deletions

17
laravel/facade.php Normal file
View File

@@ -0,0 +1,17 @@
<?php namespace Laravel;
abstract class Facade {
/**
* Magic Method that allows the calling of a class staticly. This provides a convenient API
* while still maintaining the benefits of dependency injection and testability of the class.
*
* Each facade has a "resolve" property that informs the base class of what it needs to resolve
* our of the IoC container each time an operation is called on the facade.
*/
public static function __callStatic($method, $parameters)
{
return call_user_func_array(array(IoC::container()->resolve('laravel.'.static::$resolve), $method), $parameters);
}
}