任何人都可以告诉我为什么autmader错误出现在symfony2中。 什么是parmenanat解决方案。我已经下载了与供应商的symfony2版本,所有的东西都正常工作接受当我插入自定义类并尝试使用它总是引发自动加载错误请给我它的解决方案。错误消息如下所示。
The autoloader expected class "Blogger\BlogBundle\Entity\Enquiry"
to be defined in file
"D:\wamp\www\Symfony/src/\Blogger\BlogBundle\Entity\Enquiry.php".
The file was found but the class was not in it,
the class name or namespace probably has a typo.
这是询问课。
<?php
namespace Blogger\BlogBungle\Entity;
class Enquiry
{
protected $name;
protected $email;
protected $subject;
protected $body;
public function getName()
{
return $this->name;
}
public function setName($name)
{
$this->name = $name;
}
public function getEmail()
{
return $this->email;
}
public function setEmail($email)
{
$this->email = $email;
}
public function getSubject()
{
return $this->subject;
}
public function setSubject($subject)
{
$this->subject = $subject;
}
public function getBody()
{
return $this->body;
}
public function setBody($body)
{
$this->body = $body;
}
}
?>
答案 0 :(得分:3)
查看
之间的区别namespace Blogger\BlogBungle\Entity;
和
Blogger\BlogBundle\Entity\Enquiry
错误消息? BlogBungle应该是BlogBundle ,当您定义命名空间时。