hackweekender-aw/spryker-autowiring
Composer 安装命令:
composer require hackweekender-aw/spryker-autowiring
包简介
This package enables autowiring for Spryker
README 文档
README
#Hackweekender2023
Installation
Install it with composer
composer require hackweekender-aw/spryker-autowiring
Add a namespace to your config
$config[KernelConstants::CORE_NAMESPACES] = [
[...]
'AW'
];
Usage
Yves
- Include
\AW\Yves\Kernel\ClassResolverAwareTraitin the controller - Call
$this->resolveClass(AmazingYvesClass::class)->yourAmazingMethod()
Client
- Include
\AW\Client\Kernel\ClassResolverAwareTraitin the client - Call
$this->resolveClass(AmazingClientClass::class)->yourAmazingMethod()
Zed
- Include
\AW\Zed\Kernel\ClassResolverAwareTraitin the facade - Call
$this->resolveClass(AmazingZedClass::class)->yourAmazingMethod()
Manually configure DI
- Make the dependency provider of your module to implement the interface
\AW\Shared\Kernel\DependencyInjection\ConfigurableDependencyInjectionInterface - Define the custom definitions using https://php-di.org/doc/php-definitions.html#definition-types
public function getDependencyInjectionConfig(): array
{
return [
AmazingCartOperationInterface::class => DI\autowire(AmazingCartOperation::class)
->constructorParameter('postOperationPlugins', $this->getPostOperationPlugins())
];
}
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-07-09