我对教义控制台有问题。我有一个包含以下代码的MailServiceFactory.php:
namespace Application\Service;
use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
class MailServiceFactory implements FactoryInterface
{
public function createService(ServiceLocatorInterface $serviceLocator)
{
$I_render = $serviceLocator->get('ViewRenderer');
$a_config = $serviceLocator->get('config');
return new MailService($I_render, $a_config);
}
}
use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
class MailServiceFactory implements FactoryInterface
{
public function createService(ServiceLocatorInterface $serviceLocator)
{
$I_render = $serviceLocator->get('ViewRenderer');
$a_config = $serviceLocator->get('config');
return new MailService($I_render, $a_config);
}
}
所有函数都可以工作,但是当我执行vendor/bin/doctirne-module
时,会得到以下错误:
致命错误:带有消息“Zend\ServiceManager\ServiceManager::get无法在/Users/Daniele/Apps/corradini.com/www/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceManager.php:529中获取或创建ViewRenderer实例”的未命名异常ViewRenderer
我为什么要犯这个错误?
发布于 2014-11-08 17:54:07
谢谢现在的教条控制台的功能!但是我看不懂渲染邮件的内容。
My tempate is locatend in module/Application/view/email/template.phtml
在我的module.config.php中有配置:
'template_path_stack' => array(
'application' => __DIR__ . '/../view',
),
和错误:
Zend\View\Renderer\PhpRenderer::render: Unable to render template "email/template.phtml"; resolver could not resolve to a file
哪里弄错了?
谢谢
https://stackoverflow.com/questions/26816526
复制相似问题