Download the PHP package zf-hipsters/abstract-factory without Composer
On this page you can find all versions of the php package zf-hipsters/abstract-factory. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download zf-hipsters/abstract-factory
More information about zf-hipsters/abstract-factory
Files in zf-hipsters/abstract-factory
Package abstract-factory
Short Description A simple module that removes the requirement to setup invokables and factories for services and controllers..
License
Homepage https://github.com/zf-hipsters/abstract-factory
Informations about the package abstract-factory
Abstract Factory
A simple module that removes the requirement to setup invokables and factories for services and controllers.
There is no requirement to use aliases that make your code inconsistant, just use the full namespace and the abstract will find it and instantiate it when required.
This module is aimed at saving time which would otherwise be spent on configuration.
Installation
1) Add the following requirement to your projects composer.json file.
Within the "require" section:
2) Open up your command line and run
2) Add 'ZfhAbstractFactory' to your /config/application.config.php modules
Route Example
Without ZfhAbstractFactory being enabled, you need to register your controllers within configuration such as:
When ZfhAbstractFactory is enabled, you can avoid registering controllers in this way if you use the FQN of the controller in your route.
Note: the FQN of the controller has been used.
Another example with dynamic with fixed controller and a dynamic action.
ServiceManager Example
In your controller file
Calling a factory