textcontrol / textcontrol-laminas-reportingcloud
Laminas模块(之前称为Zend Framework 3模块)用于ReportingCloud Web API。由Text Control GmbH编写和支持。
5.0.6
2024-06-27 05:28 UTC
Requires
- php: ^8.3
- laminas/laminas-mvc: ^3.3
- laminas/laminas-servicemanager: ^3.12
- laminas/laminas-view: ^2.20
- psr/container: ^1.0 || ^2.0
- textcontrol/textcontrol-reportingcloud: ^2.0
Requires (Dev)
- ctw/ctw-qa: ^4.0
- phpstan/phpstan-phpunit: ^1.1
- phpunit/phpunit: ^10.0
- symfony/var-dumper: ^7.0
README
ReportingCloud Laminas模块
使用Composer安装
使用Composer在您的项目中安装ReportingCloud Laminas模块
composer require textcontrol/textcontrol-laminas-reportingcloud:^3.0
安装后,您需要将配置文件
/vendor/textcontrol/textcontrol-laminas-reportingcloud/config/reportingcloud.local.php.dist
复制到您的Laminas应用程序中
/config/autoload/reportingcloud.local.php
注意:已移除.dist前缀。
然后,将ReportingCloud凭据添加到配置文件中
return [ 'reportingcloud' => [ 'credentials' => [ 'api_key' => 'your-api-key' ], ], ];
完成此操作后,您即可在应用程序的模块配置文件中启用模块。
在文件/config/modules.config.php中,添加以下行
'TextControl\ReportingCloud',
您的/config/modules.config.php文件可能看起来像这样
return [ 'Laminas\Router', 'Laminas\Validator', 'TextControl\ReportingCloud', 'Application', ];
现在,您已经准备好在Laminas应用程序中使用Reporting Cloud了。
Laminas中的使用
ReportingCloud Laminas模块在Service Manager中注册了一个以ReportingCloud为键的服务。
因此,在以下工厂中可用
use Interop\Container\ContainerInterface; use Laminas\ServiceManager\Factory\FactoryInterface; class Factory implements FactoryInterface { public function __invoke(ContainerInterface $container, $requestedName, ?array $options = null) { $reportingCloud = $container->get('ReportingCloud'); // instantiate and return your object here } }
控制器插件
为了方便在控制器中访问,以下控制器插件可用
$this->reportingCloud(); // returns a \TextControl\ReportingCloud\ReportingCloud instance
视图辅助器
为了方便在视图中访问,以下视图辅助器可用
$this->reportingCloud(); // returns a \TextControl\ReportingCloud\ReportingCloud instance
从Zend Framework 3迁移到Laminas
如果您正在从Zend Framework 3迁移到Laminas,请参阅ReportingCloud Web API的Zend Framework 3模块发生了什么?
获取支持
Text Control GmbH支持官方的ReportingCloud Web API Laminas模块。要开始与ReportingCloud支持部门的PHP人员进行对话,请创建工单,并在部门选择列表中选择ReportingCloud。
