php报错,调用非对象上的成员函数validate ?

php报错,调用非对象上的成员函数validate 


慕哥9229398
浏览 878回答 1
1回答

慕桂英546537

命名空间Venom \ CoreBundle;使用Symfony \ Component \ HttpKernel \ Bundle \ Bundle;use \ Symfony \ Component \ DependencyInjection \ ContainerInterface;VenomCoreBundle类扩展了Bundle{private static $ containerInstance = null;public function setContainer(ContainerInterface $ container = null){父:: setContainer($容器);self :: $ containerInstance = $ container;}public static function getContainer(){return self :: $ containerInstance;}}使用适当的命名空间。然后,在需要容器的类中使用bundle的命名空间。您可以通过调用容器$ container = VenomCoreBundle :: getContainer()
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Ruby