Either:
<a href="{{ $link-address }}">{{ $link-text }}</a>
Or, use Laravel's helper functions (https://laravel.com/docs/5.2/helpers):
{{ route($route-name) }}
{{ url($link-address) }}
thanks.
if I user these:
<a href="{{ $link-address }}">{{ $link-text }}</a>
Where do I initiate the value?
The simplest way is to pass the data into the view where you create it (whether that is in a controller, directly from routes.php, or otherwise).
For example:
return view('index.blade.php', ['link-address' => 'http://example.com', 'link-text' => 'Click Here']);
The array items which you pass to the view will be available within your view with the names of the array keys that you have defined (so in this case the variables $link-address and $link-text will be available to you).
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community