Really new in Laravel and frameworks at all so please bear with me on this. I'm trying to learn it and I choose to write simple index page with few products ( title, price, image, description ). So far everything is there. Now I'm trying to put ViewMore
button on the description section and when I click on button to load me new page with more information for this product.
This is the view of index page where I show all products and want to make button view more...
@if($product['image'])
<img class="max-150" src="{{ $product['image'] }}" alt="{{{ $product['title'] }}}" />
<br /><br />
@endif
@if($product['description_small'])
<p>{{ $product['description_small'] }}</p>
<p>{{ str_limit($product['description_small'], $limit = 250, $end = '<br><br> <a href="{{ URL::to('/product/single/' . $product['product_id']) }}" class="btn btn-primary">View More</a>') }}</p>
@endif
For now I've got error in link of View More and the error says
production.ERROR: exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'syntax error, unexpected 'product_id' (T_STRING)' in....
When I make it only with a href it's working great...
<p><br><br> <a href="{{ URL::to('/product/single/' . $product['product_id']) }}" class="btn btn-primary">View More</a></p>
View More') }}` it throws this error.. but if I make it like this `
` there is no problems but I don't get description – S.I. May 30 '16 at 16:22View More