如果我的url是这样的 http:/localhostcustomerview7。
'route' => 'customer[:action[:id]]
我想用7作为editAction()的id,但我不能用
$id = (int) $this->params()->fromRoute('id' , '0')。
那么,我怎样才能得到它呢?谢谢你的帮助
解决方法是修改view.phtml
之前:
a href = $this->url('customer', ['action' => 'edit']) ?>
后:
a href = $this->url('customer', ['action' => 'edit', 'id' => $customer->id])
有了这个身份证'你可以使用:$id = (int) $this->params()->fromRoute('id' , '0');在editAction()