0

I have following code:

    return array(
        ULogt::UPDATE => '

 <div>     
    <a href="#link">Navigate</a>
 </div>
'

This code locates in the class called links.php. I need to navigate to ('viewform', array('model'=>$this->loadJson($id)), when the user presses Navigate button. I do not know how to insert this code instead of #link. How can I do it?

phpdev
  • 511
  • 4
  • 22

1 Answers1

1
CHtml::link( 
   "Navigate", 
   "javascript:void(0);", // link for destination or you can handle same with jQuery
   array(
    'id' => 'navigation-id', // id for handeling in jQuery
    'key' => $data, // Required data will be appeared as attributes for this link
   )
);

You can create link like

Yii::app()->createUrl(
         '/profile/membership/view', // your link
         array(
             'id'=> 1  // data to be sent
         )
 )

Check for URL formating

Community
  • 1
  • 1
rakesh mallesh
  • 168
  • 1
  • 8