You need to remove the "{{ }}"
around URL::route:
{{ HTML::image_link(URL::route('profile'), 'public/images/close.png', '', 'Image 01') }}
Question
i'm define custom macro such as link_image
and into that i want to use {{ URL::route('profile') }}
. after inserting this below line i get error:
{{ HTML::image_link("{{ URL::route('profile') }}", 'public/images/close.png', '', 'Image 01') }}
Error :
syntax error, unexpected '}', expecting ',' or ';'
My macro :
HTML::macro('image_link', function($url = '', $img='img/', $title ='' ,$alt='', $param = false, $active=true, $ssl=false)
{
$url = $ssl==true ? URL::to_secure($url) : URL::to($url);
$img = HTML::image($img,$alt);
$link = $active==true ? HTML::link($url, '#', $param) : $img;
$link = str_replace('#', $img.$title ,$link);
return $link;
});
Solution
You need to remove the "{{ }}"
around URL::route:
{{ HTML::image_link(URL::route('profile'), 'public/images/close.png', '', 'Image 01') }}