Laravel 4 passing a mixture of blade syntax and html to a view -
on annivesariescontroller:
public function index() { $annivesaries = annivesary::where('year', '>', 2011)->take(1)->get(); $data = "{{{\$annivesary->title }}} annivesary held in {{{ \$annivesary->year }}}"; return view::make('annivesaries.index', compact('annivesaries')) ->with('user', auth::user()) ->with('data', $data); }
on views/annivesaries/index.blade.php :
@foreach ($annivesaries $annivesary) <tr> <td> {{ link_to_route('annivesaries.show', $data,array($annivesary->id)) }} </td> </tr> @endforeach
but when access /annivessaries route:
{{{$annivesary->title }}} annivesary held in {{{ $annivesary->year }}}
while expect like:
annivessary 1 held in 2011
please let me know how can point.
what trying sending blade syntax view won't work because converted htmlentities
.
try in view {{ link_to_route('annivesaries.show', "$annivesary->title annivesary held in $annivesary->year",array($annivesary->id)) }}
.
Comments
Post a Comment