【发布时间】:2017-02-28 12:34:45
【问题描述】:
我有一个很奇怪的问题:
我有两条路线: 第一个带有通配符:
/**
* @Route("/test/{test}", name="test")
* @param type $route
*/
public function testAction(Request $request, $test) {
return $this->render('resource/showResource.html.twig', [
'test' => $test
]);
}
第二个是没有通配符的:
/**
* @Route("/test", name="test")
* @param type $route
*/
public function testAction(Request $request) {
return $this->render('resource/showResource.html.twig', [
'test' => 'something'
]);
}
问题是当我运行第一个 (http://localhost/app_dev.php/test/1) 时,我的 CPU 利用率几乎达到 100%(进程:httpd.exe => Apache HTTP Server。
第二个就没有这个问题了。
是什么原因造成的?
【问题讨论】:
-
对{$test}有什么具体要求吗?意味着它应该只是整数或其他东西......?
-
最终它必须是整数,但现在没有必要。
标签: php apache symfony cpu-usage