matryoshka-model / zf2-matryoshka-module
Matryoshka的ZF2集成模块
v0.8.0
2016-03-17 17:43 UTC
Requires
- php: >=5.5
- matryoshka-model/matryoshka: ~0.8.0
- zendframework/zend-modulemanager: 2.*
- zendframework/zend-mvc: 2.*
Requires (Dev)
- phpunit/phpunit: ~4.3
- satooshi/php-coveralls: dev-master
Suggests
- matryoshka-model/mongo-wrapper: MongoDB matryoshka wrapper
- matryoshka-model/rest-wrapper: Matryoshka wrapper aimed at creating restful API clients
- matryoshka-model/service-api: A set of utilities aimed at consuming HTTP API services
This package is not auto-updated.
Last update: 2024-09-14 15:37:26 UTC
README
ZF2模块为Matryoshka -------------------------为Matryoshka提供的ZF2集成模块。
此存储库包含一个注册默认服务并提供一组有用控制器插件的ZF2模块。
社区
安装
使用 Composer
将以下内容添加到您的 composer.json
文件中
"require": { "matryoshka-model/zf2-matryoshka-module": "~0.8.0" }
最后,将模块名称添加到项目配置的 config/application.config.php
中的 modules
键下
return [ /* ... */ 'modules' => [ /* ... */ 'Matryoshka', ], /* ... */ ];
如何使用
在使用此模块之前,您只需根据您的模型配置Matryoshka设置。
然后您就可以在控制器中使用内置插件。
示例
public function fooAction() { $myModel = $this->model()->get('MyModel'); // Retrieve a model instance through the ModelManager $myObject = $this->object()->get('MyObject'); // Retrieve an object instance through the ModelManager }