我目前正在尝试将我的 Symfony2 应用程序升级到 Symfony3。我有一个 SecurityController
覆盖 FOSUserBundle\SecurityController
:
namespace Acme\MyBundle\Controller;
use Symfony\Component\DependencyInjection\ContainerAware;
class SecurityController extends ContainerAware
{
// ...
}
但我得到了一个
ClassNotFoundException
:Attempted to load class "ContainerAware" from namespace "Symfony\Component\DependencyInjection".
Did you forget a "use" statement for another namespace?
我在 upgrade notes 中找不到任何更改吗? .有人可以指出我解决这个问题的方法吗?
最佳答案
由于此更改 PR , ContainerAware
已在 2.8 中弃用,并在 3.0 中移除以支持 ContainerAwareTrait
关于namespaces - Symfony3 升级的命名空间问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34373058/