php - VueJS variable inside URL::action in Laravel -
i new vuejs.
i have link using laravel helpers:
<a href="{!! url::action('tournamentcontroller@edit', $tournament->id) !!}">{{ $tournament->id }}</a>
as inside vuejs v-for, need refer vue variables load ajax.
so, tried write that:
<a href="{!! url::action('tournamentcontroller@edit', @{{ tournament.id }} ) !!}">@{{ tournament.id }}</a>
but
parse error: syntax error, unexpected '{' (view: /home/vagrant/code/resources/views/tournaments/index.blade.php)
any idea how mix laravel helper , vuejs?
first of looks you're missing quotes around @{{ tournament.id }}
.
but after playing around myself doesn't seem possible @ moment due routes using same brackets placeholders.
a workaround create simple function somewhere generates url unique placeholder , afterwards str_replace
call on generated url.
Comments
Post a Comment