Closed fdisotto closed 10 years ago
Hey, I've updated the readme with info about creating custom facades.
In your case, you wold register custom singleton via:
$app->container->singleton('my_singleton', function(){ return new MySingleton(); });
Then create a facade class for this component:
class MyFacade extends SlimFacades\Facade
{
// return the name of the component from the DI container
protected static function getFacadeAccessor() { return 'my_singleton'; }
}
Now I've understand how to use these facades :)
Hi, how can I use singleton ($app->container->singleton) with facades?