2016-08-05 80 views
0

我有一个像下面如何隐藏变量laravel

@foreach代码($模式为$行)

<tr> 
     <td>{{ $i++}}</td> 
     <td> 
     {{ 
     Employee::where('nik','=',$rows->nik)->first(['nama']) 

     }} 
     </td> 
     <td>{{ $rows->nik }}</td> 


     <td> 
     {!! HTML::link('employee/profile_app/'.$rows->nik,'view', array('class'=>'fa fa-pencil-square-o action-button')) !!} 
     </td> 
    </tr> 
    @endforeach 

,结果是这样的 enter image description here

如何隐藏那“纳玛”变量

+0

你是什么意思的“隐藏”?什么是预期的输出? –

回答

1
@foreach ($model as $rows) 

<tr> 
    <td>{{ $i++}}</td> 
    <td> 
    {{ 
    Employee::where('nik','=',$rows->nik)->first(['nama'])->nama 

    }} 
    </td> 
    <td>{{ $rows->nik }}</td> 


    <td> 
    {!! HTML::link('employee/profile_app/'.$rows->nik,'view', array('class'=>'fa fa-pencil-square-o action-button')) !!} 
    </td> 
</tr> 
@endforeach