$title = $image->image->title; $path = $image->image->path; $url=$image->image->url; if(!empty($url)){echo 'href="'.$url.'"';} title="{$title}" >