无法将 id 与锚标记中的 URL link 连接起来

Unable to concatenate id with the URL link in the anchor tag

我想在锚标记中将 id 与 URL link 连接起来。目前,它仅路由到 URL 但未获取 id,因此 id 未与 URL 连接。

[
    'label' => 'online ordering link',
    'format' => 'raw',
    'value'=>'<a href="http://localhost:4200/clientSideDashboard/"'.$model->id.'">Generate Link</a>',
],
[
                'label' => 'online ordering link',
                'format' => 'raw',
                'value'=>'<a href="http://localhost:4200/clientSideDashboard/"'.$model->id.'">Generate Link</a>',
],

永远行不通。当您像这样连接值时,您生成的是

<a href="http://localhost:4200/clientSideDashboard/"[model-id]">Generate Link

尝试:

[
                'label' => 'online ordering link',
                'format' => 'raw',
                'value'=>'<a href="http://localhost:4200/clientSideDashboard/'.$model->id.'">Generate Link</a>',
],