I am trying to add a variable to the end of an link <a href="foo.com/$ID">LINK</a> I am using Laravel and am passing an array of data to the view were its looped through and then displayed.
View
<form action="{{ URL::route('Search')}}" method="get">
Search<input type="text" name="query" /><br>
<input type="submit" value="Search" />
{{Form::token()}}
</form>
<br>
<?php if (count($Results) > 0): ?>
<table style="border-collapse: separate; border-spacing: 25px 5px;">
<thead>
<tr>
<p></p><th><?php echo implode('</th><th>', array_keys(current($Results))); ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($Results as $row): array_map('htmlentities', $row); ?>
<tr>
<td><?php echo implode('</td><td>', $row); ?></td>
</tr>
<?php endforeach; ?>
<tbody>
</table>
<?php endif; ?>
this displays.
title place_film_country wab_id
4th of February Sri Lanka 266
So I am trying to turn the wab_id and pass it into a variable and stick it on the end of the link.
Controller
public function Search(){
$query = Input::get('query');
$raw_results = DB::Table('films')->select('title', 'place_film_country', 'wab_id')
->where('title', 'LIKE', "%$query%")
->orwhere('place_film_country', 'LIKE', "%$query%")
->orwhere('genre', 'LIKE', "%$query%")
->orwhere('wab_id', 'LIKE', "%$query%")
->get();
$array = json_decode(json_encode($raw_results), true);
return View::make('Index')->with('Results', $array);
}