nacis
(Nsahin)
November 15, 2013, 7:30pm
1
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.
find documentation on the function
http://www.yiiframework.com/doc/api/1.1/CHtml#ajaxLink-detail
check the signature
ajaxLink(string $text, mixed $url, array $ajaxOptions=array ( ), array $htmlOptions=array ( ))
compare with yours
ajaxLink('...', CController::createUrl(...), array('id'=>'somerandomid",'update' => '#secondcontainer'))
find the differences
array $ajaxOptions=array ( ), array $htmlOptions=array()
vs
array('id'=>'somerandomid",'update' => '#secondcontainer')
and the typos
‘id’=>' somerandomid"
problem solved.
nacis
(Nsahin)
November 15, 2013, 8:00pm
3
Thanks Orey for the answer.
Obviously, I confused the arrays there.