0

I'm having a set of html codes present in different blade file in view, I'm trying to add these with foreach loop, but blade template is not able to concatenate the files following is my code:

@foreach($getplugin as $renderer)

    @include('themes.'$template->theme->name'.Plugins.'$plugins->find($renderer)->type'.'$plugins->find($renderer)->id)

@endforeach

I'm getting following error:

Parse error: syntax error, unexpected '$template' (T_VARIABLE), expecting ',' or ')' (View: C:\wamp\www\NitsEditor\resources\views\nitseditor\test.blade.php)

Please help out with this. Thanks

Nitish Kumar
  • 6,054
  • 21
  • 82
  • 148

1 Answers1

2

You're trying to concatenate strings and forgetting to add dots for the concatenation.

Instead of 'themes.'$template it should be 'themes.'.$template, and so on. You seem to be missing all of them.

Joel Hinz
  • 24,719
  • 6
  • 62
  • 75
  • Hey thanks for the update, while doing so as suggested by you, I'm getting an error `Parse error: syntax error, unexpected ''.Plugins.''`, this is the folder where all the views are stored. I placed `.` in front of every `.$template`, `.$plugins` – Nitish Kumar Jul 22 '16 at 07:13
  • You need to place around them, not just in front. Please google php concatenation, you really need to understand what it is. – Joel Hinz Jul 22 '16 at 07:14