This repository was archived by the owner on Jan 16, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Docs IOC Integration
Frank Kleine edited this page Apr 7, 2012
·
1 revision
Stubbles provides an class named net::stubbles::ioc::stubApp that you can use in your Stubbles MVC application, which will create a stubFrontController using given bindings.
stubApp::createFrontController(new stubPropertiesBindingModule($projectPath),
'net::stubbles::ipo::ioc::stubIpoBindingModule',
stubWebsiteBindingModule::createWithXmlProcessorAsDefault('interceptors')
->enableRss('interceptors')
->enableJsonRpc('interceptors')
)
->process();
To add your own bindings you may implement the net::stubbles::ioc::module::stubBindingModule interface.
#php
<?php
/**
*Application specific bindings
*/
stubClassLoader::load('net::stubbles::ioc::module::stubBindingModule');
/**
*Application specific bindings
*/
class MyBindingModule extends stubBindingModule
{
/**
***Configure the bindings
*
***@param stubBinder $binder the binder to configure
***/
public function configure(stubBinder $binder)
{
$binder->bind('Foo')->to('FooImpl');
// more bindings should follow here
}
}
?>