Thursday, 15 May 2014

php - Append parameters to createUrl() Yii -



php - Append parameters to createUrl() Yii -

i seek wrote ajax request in yii 1 jquery. in url seek append value of id attribute of link, cant that. here code:

yii::app()->clientscript->registerscript('vot', " $(document).ready(function(){ $('.js-register-member').click(function(e){ e.preventdefault(); $.ajax({ method: 'post', url: '" . $this->createurl('cre/register/124'). "', }); }); });

"); need set parametr 124 situated... seek set there somethink like:

$(this).attr('id'); 500 error

try this. hope work

yii::app()->clientscript->registerscript('vot', " $(document).ready(function(){ $('.js-register-member').click(function(e){ e.preventdefault(); var id = $(this).attr('id'); $.ajax({ method: 'post', url: '" . $this->createurl('cre/register/') . "' + id , }); }); }); ");

php jquery ajax yii

No comments:

Post a Comment