我怎样才能使用zend窗体视图助手?Zend表达式:我如何使用zend表单视图助手?
这样做...... How can I use zend-form view helpers?
其结果是,关于弃用类contiguration enter image description here
我在做什么错误消息?
我怎样才能使用zend窗体视图助手?Zend表达式:我如何使用zend表单视图助手?
这样做...... How can I use zend-form view helpers?
其结果是,关于弃用类contiguration enter image description here
我在做什么错误消息?
看看这个https://github.com/zendframework/zend-expressive/issues/335
这里是我厂的样子:
public function __invoke(ContainerInterface $container)
{
$config = $container->has('config') ? $container->get('config') : [];
$config = isset($config['view_helpers']) ? $config['view_helpers'] : [];
$manager = new HelperPluginManager($container, $config);
return $manager;
}
更新:
因为我不清楚,让我们再次尝试。
你可以从github上看到后,为了消除有关不推荐类的消息,你需要创建一个文件config/autoload/zend-form.global.php
与内容:
<?php
use Zend\Form\ConfigProvider;
$provider = new ConfigProvider();
return $provider();
这样做,就不再需要添加zend-从您正在创建的工厂内将服务管理器配置窗体视图帮助程序配置。
义线
$formConfig = new FormHelperConfig();
$formConfig->configureServiceManager($manager);
不再需要。
此外,方法的HelperPluginManager
setServiceLocator
已经过时,所以你改变这两条线路:
$manager = new HelperPluginManager(new Config($config));
$manager->setServiceLocator($container);
一个行:
$manager = new HelperPluginManager($container, $config);
至于导致您的__invoke
功能看起来就像这样:
public function __invoke(ContainerInterface $container)
{
$config = $container->has('config') ? $container->get('config') : [];
$config = isset($config['view_helpers']) ? $config['view_helpers'] : [];
$manager = new HelperPluginManager($container, $config);
return $manager;
}
你在你内部使用视图助手r视图模板。 Here你可以找到所有zend-form视图助手列表以及示例。
我希望这使事情更清晰,因为我吮吸解释的东西。
这是如何回答这个问题的?你可以说得更详细点吗? –
请提供详细的配置结构? – Drakulitka
我使用'AbstractActionFactory',我该如何实现它。 [https://xtreamwayz.com/blog/2015-12-30-psr7-abstract-action-factory-one-for-all] – Drakulitka