How to create lazy factory 28/10/2014
Register it in config.neon
- SeoFactory Create interface with one public method create with annotation (or return type) for our class.
interface SeoFactory { /** @return SEO */ public function create(); } class SEO { // ... } The DI container will now create its instance when needed.
Register it in config.neon
- SeoFactory
Create interface with one public method create
with annotation (or return type) for our class.
interface SeoFactory
{
/** @return SEO */
public function create();
}
class SEO
{
// ...
}
The DI container will now create its instance when needed.