How can I put href with dynamically route in column render?

How can I put href with dynamically route in column render?

ferran_munozferran_munoz Posts: 28Questions: 7Answers: 0

Hi everyone.

I'm mounting a datatable with a column that returns me a link with a URL created dynamically with the user id. The mode of mount the route is {{ route(alias, ['id'] => user.id) }} (I'm working with Laravel Blade files for the view)

So, when I'm mounting the column, I do this: return '<a href="{{ route(alias, ['id'] => "'+full.id+'") }}">UserName</a>'

But always the result that I have is **http://url.com/users/user/%27+full.id+%27**

So, how I can achieve to return the correct URL?

Answers

  • ferran_munozferran_munoz Posts: 28Questions: 7Answers: 0

    Don't worry. I create the route dynamically when I get data and then I put directly to Datatable like a normal column.

    The WebApi:

    The view:

    And here appears the correct ID

    Thanks.

This discussion has been closed.