Ниже приведен код моего контроллера Wordings_test.php
Проблема в том, что я не могу напечатать @ wording.product.Хотя я могу напечатать @ wording.template_name.Спасибо
class Wordings_test extends Controller{
function show($f3)
{
$wordings = Wordings::all()->orderBy('id')->select()->toArray();
foreach ($wordings as $wording) {
$wording['product'] = ProductTypes::where(['id' =>
$wording['product_type_id']])->select()->getAttribute('name');
}
$f3->set('wordings',$wordings);
$this->render('admin/wordings/view')
}
Ниже приведен код шаблона view.html
<a href="/admin/brokerage-headgroups/add" class="btn btn-success pull-right showLoader"><i class="fa fa-user-plus"></i> Add New Brokerage Head Group</a>
<div class="row">
<div class="form-group">
<div class="tab-content">
<div id="brokerageheadlist" class="active in tab-pane fade">
<table class="table table-bordered adminTable" id="brokerageheadList">
<thead>
<tr>
<th>Wording</th>
<th>Product Type</th>
<th style="width:140px;">Controls</th>
</tr>
</thead>
<tbody>
<repeat group="{{ @wordings }}" value="{{ @wording }}">
<tr>
<td>{{ @wording.template_name }}</td>
<td>
{{ @wording.product }}
</td>
<td>
<a class="btn btn-sm btn-info showLoader" href="/admin/wordings/edit-wordings/{{ @wording.id }}">Edit</a>
<button type="button" class="btn btn-danger btn-sm" data-toggle="modal" data-target="#myModal{{@brokeragehead.id}}">Delete</button>
<div id="myModal{{@brokeragehead.id}}" class="modal fade" role="dialog">
<div class="modal-dialog">