Same Id To Chtml:ajaxlink

Hello;

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?

<?php

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

?>

Thanks.

Here’s how to resolve issues like this.

  1. find documentation on the function

http://www.yiiframework.com/doc/api/1.1/CHtml#ajaxLink-detail

  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()

vs


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

and the typos

‘id’=>'somerandomid"

  1. problem solved.

Thanks Orey for the answer.

Obviously, I confused the arrays there.