我需要 URL id 从 zend 框架 2 中的数据库中获取特定数据。这是我的控制器脚本:
$request = $this->getRequest();
return new ViewModel(
array('request' => $request));
这是视图:
echo $this->request;
我得到如下输出:
GET http://public.localhost.com:80/property/274 HTTP/1.1 Cookie: _ga=GA1.2.1235676771.1376588476; PHPSESSID=7bs59pfipit9eekd3tqmcocna3 Host: public.teamleads.com Connection: keep-alive Cache-Control: max-age=0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.62 Safari/537.36 Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US,en;q=0.8
但是,我只需要属性 id,即:274。我该怎么办?