简体   繁体   中英

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

I want to concatenate the id with the URL link in the anchor tag. Currently, it only routes to the URL but is not getting the id , so id is not concatenating with the 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>',
],

Would never work. When your concatenating value like that what you're generating is

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

Try:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM