Same Id To Chtml:ajaxlink


I have a partially rendered view that also contains CHtml:ajaxlink elements. However even though I assign an id to these links, Yii auto assigns yt0, yt1 to them. So a confusion with the main page CHtml links occurs. Here is my id assignment in my renderedpartial view. Could you see the problem?


echo CHtml::ajaxLink(’<i class=“icon-book”></i>Budget Details’, CController::createUrl(‘site/budgetrealization’), array(‘id’=>'somerandomid",‘update’ => ‘#secondcontainer’));



Here’s how to resolve issues like this.

  1. find documentation on the function

  1. check the signature

ajaxLink(string $text, mixed $url, array $ajaxOptions=array ( ), array $htmlOptions=array ( ))

  1. compare with yours

ajaxLink('...', CController::createUrl(...), array('id'=>'somerandomid",'update' => '#secondcontainer'))

  1. find the differences

array $ajaxOptions=array ( ), array $htmlOptions=array()


array('id'=>'somerandomid",'update' => '#secondcontainer')

and the typos


  1. problem solved.

Thanks Orey for the answer.

Obviously, I confused the arrays there.