【发布时间】:2009-06-22 09:02:06
【问题描述】:
在CakePHP中,在url中作为参数传递的值可以通过controller属性获取
<?php $userid= $this->params['pass'][0];?>
我想在 jQuery 代码中使用 $userid。
$("#displayPanel #saveForm").live("click", function(){
document.location = 'http://localhost/cake_1_2/forms/homepage';
});//Click on SaveForm
假设如果 userid 是 12,我需要 document.location 是 'http://localhost/cake_1_2/forms/homepage/12'。
如何在jQuery中使用php变量?
【问题讨论】: