我更改了默认设置" router"在config_dev.yml文件中:" routing.yml"被更改为" routing.php"。 routing.php的内容:
use Symfony\Component\Routing\RouteCollection;
use Symfony\Component\Routing\Route;
$collection = new RouteCollection();
$collection->add('homepage', new Route('/', array(
'_controller' => 'AppBundle:Default:index',
)));
return $collection;
但是当我去网站时,我得到一个"错误:在整数"上调用成员函数addResource()。堆栈跟踪:
in vendor\symfony\symfony\src\Symfony\Component\Routing\Loader\PhpFileLoader.php at line 41 -
$this->setCurrentDir(dirname($path));
$collection = self::includeFile($path, $this);
$collection->addResource(new FileResource($path));
return $collection; }