samedi 5 mars 2016

Pass a variable to an other view

I try to load a view(project_template) in an other view. My problem ist, how i can give my $project-variable to the 'project_template'-view which i create in my main-view with "View:make".

Actually i use ->with($project) But when I try to use it in my template_view, i get an non-object-error I also used "compact" what also not worked for me.

In my main-view i can use the $project-variable without problems

View:

@foreach($projects as $project)
<tr class="gradeA">
   <td>
   <td>{!! $project->description !!}</td>
   <td>
      {!! View::make('shared.tables.project_template')->with($project)->render() !!}
   </td>
</tr>
@endforeach

Project_Template-View:

{!! $project->project_name !!}

Error-Message

ErrorException in 0f9dcdc70fd0be3b50d7a39ad7bc90d7 line 4:
Trying to get property of non-object 

Thanks for the help!



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1QV6XcG
via IFTTT

Aucun commentaire:

Enregistrer un commentaire