문제

Iam trying to pass variable along with Chtml button in Yii using the following code

 echo CHtml::button('Update', array('submit' => array('serviceRequest/Update',array('id'=>$requestId))));

But it is showing 404 error due to the url problem. On clicking some dummy characters is getting added to the "id" .
On clicking the button Iam getting the following url. ../serviceRequest/Update/0%5Bid%5D/4 . How to remove this special characters and how can I get the correct url as ../serviceRequest/Update/id/4 . I need button itself there..
Thanks in advance

도움이 되었습니까?

해결책

Use

array('submit' => $this->createUrl('serviceRequest/Update',array('id'=>$requestId)))
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top