0

任何人都可以让我知道为什么自动加载器错误出现在 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;
}


}


?>
4

1 回答 1

3

查看两者之间的区别

namespace Blogger\BlogBungle\Entity;

 Blogger\BlogBundle\Entity\Enquiry

在错误信息中?当您定义命名空间时,BlogBu​​ngle 应该是 BlogBu​​ndle 。

于 2013-02-23T11:39:36.887 回答