我关注the tutorial。当我使用命令
时php app/console doctrine:fixtures:load
然后我收到错误
C:\wamp\www\Symfony>php app/console doctrine:fixtures:load
'stty' is not recognized as an internal or external command,
operable program or batch file.
[RuntimeException]
The autoloader expected class "Symfony\Bundle\DoctrineFixturesBundle\DoctrineF
ixturesBundle" to be defined in file "C:\wamp\www\Symfony\app/../vendor/bundles\
Symfony\Bundle\DoctrineFixturesBundle\DoctrineFixturesBundle.php". The file was
found but the class was not in it, the class name or namespace probably has a ty
po.
我是symfony2的新手。
答案 0 :(得分:2)
我注意到的第一个问题是你没有使用DoctrineFixturesBundle
的正确名称空间。我建议你更新库。
警告:命名空间已更改
此捆绑包以前位于
Symfony\Bundle
命名空间下,现在已移至Doctrine\Bundle
命名空间。
其次,您需要在DoctrineFixturesBundle
内声明AppKernel
。
// ...
public function registerBundles()
{
$bundles = array(
// ...
// Be carefull with the namespace!
new \Doctrine\Bundle\DoctrineFixturesBundle\DoctrineFixturesBundle(),
// ...
);
// ...
}
您可以在此处找到更多信息:DoctrineFixturesBundles
(不是最新的!)