使用composer
在wamp服务器上安装symfony3很好在http://localhost:9080/SymfonyApp/web/
上我收到欢迎页面,很好
创建了todocontroller.php,如下所示:C:\ wamp \ www \ symfonyApp \ src \ AppBundle \ Controller
#
namespace AppBundle\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
class TodoController extends Controller
{
/**
* @Route("/todos", name="todo_list")
*/
public function indexAction(Request $request)
{
die('TODOS');
// replace this example code with whatever you need
return $this->render('default/index.html.twig', [
'base_dir' =>
realpath($this->getParameter('kernel.root_dir').'/..').DIRECTORY_SEPARATOR,
]);
}
}
#
当我去http://localhost:9080/SymfonyApp/web/todos
时我应该在浏览器上看到TODOS,但我得到404错误
有人可以告诉我路线有什么问题吗?