HumusMvc integrates Zend Framework 2's ModuleManager and ServiceManager in a ZF1 application
MIT License
HumusMvc integrates Zend Framework 2's ModuleManager and ServiceManager in a ZF1 application. There is also a HumusMvcSkeletonApplication. No Zend_Application will be used any more.
Usually you would install HumusMvc in the HumusMvcSkeletonApplication. If you want to follow that steps, please take a look at the installation instructions of the HumusMvcSkeletonApplication.
However, you can install HumusMvc in your custom skeleton application:
"prolic/humus-mvc": "dev-master"
to your composer.json
php composer.phar install
Sample view configuration in module.config.php
return array(
'view' => array(
'classname' => 'HumusMvc\View',
'useViewRenderer' => true,
'useStreamWrapper' => false,
'doctype' => 'XHTML1'
)
);
classname (optional): The view class to use. Must be an instance of HumusMvc\View useViewRenderer, doctype, contentType, assign, etc. are default config keys for Zend_View
A special plugin loader (HumusMvc\View\HelperPluginManager) will get injected into the view object.
Sample front controller configuration in module.config.php:
return array(
'front_controller' => array(
'controller_directory' => array(
'test' => __DIR__ . '/../src/test/controllers' // key = name of module, value = path to controllers in this module
),
'module_controller_directory_name'=> 'controllers',
'base_url' => '/',
'params' => array(
'displayExceptions' => false, // true for development
'disableOutputBuffering' => true
),
'plugins' => array(
'actionStack' => 'Zend_Controller_Plugin_ActionStack',
'putHandler' => array(
'class' => 'Zend_Controller_Plugin_PutHandler',
'stack_index' => 10
),
),
'throw_exceptions' => false,
'return_response' => false,
'default_module' => 'default',
'default_action' => 'index',
'default_controller_name' => 'index',
)
);
controller_directory: Key = "ModuleName", Value = "Path to controllers in that module" plugins: Key = "PluginName", Value = "PluginClass" or array (class and stack_index) - if a plugin is registred in service locator, the plugin will be loaded from service locator, otherwise it will simply be instantiated with "new". base_url, params, module_controller_directory_name, etc. are default config keys for the front controller
A special plugin loader (HumusMvc\Controller\Action\HelperPluginManager) will get injected into the action controller object.
Action helpers can be configures by module manager: module config key "action_helpers", interface for module class "HumusMvc\ModuleManager\Feature\ActionHelperProviderInterface" and method in module class "getActionHelperConfig"