'Combine Datatable Column For display Link

I am using customized SSP class from github repo

Its working fine as expected. I want display a link in my column like below

<a href="https://example.com/vendors/view/'.$d.'">Vendor Name</a>

But I want use vendor id in href and vendor name as link name But in SSP class, I do not know how I can combine two column data to show link.

$columns = array(
    
    array( 'db' => '`e`.`error_time`', 'dt' => 0, 'field' => 'error_time', 
    'formatter' => function( $d, $row ) {
        $time = time_elapsed_string($d,SERVER_TIMEZONE);
        return $time;
    }),
    
    array( 'db' => '`v`.`vendor_name`', 'dt' => 1, 'field' => 'vendor_name' ),
    array( 'db' => '`e`.`error_vendor`', 'dt' => 2, 'field' => 'error_vendor', 
    'formatter' => function( $d, $row ) {
        $link = '<a href="https://example.com/vendors/view/'.$d.'">Vendor Name</a>';
        return $link;
    }),
    array( 'db' => '`e`.`error_details`', 'dt' => 3, 'field' => 'error_details' ),
    array( 'db' => '`e`.`error_action`', 'dt' => 4, 'field' => 'error_action' )
    
);

For achieve my goal, I need two column data in one called dt1 and dt2. I am little new in PHP and does not know what actually I can do for solve the puzzle. Let me know if someone here can help me for do it.

Thanks!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source