【发布时间】:2017-02-28 19:16:21
【问题描述】:
我有一个从数据库中填充的表格:
@extends('layouts.master')
@section('main')
@parent
<table border=1 align=center;>
<tr><td rowspan=10><img src="media/productimg/question.jpg" width=250px></td>
<th>Márka</th><td colspan=3>{{ $productdetails->brand }}</td></tr>
<tr><th>Beszállító</th><td colspan=3>{{ $productdetails->supplier }}</td></tr>
<tr><th>{{ $productdetails->type }}</th>
<th colspan=3>{{ $productdetails->name }}</th></tr>
<tr><th>Nettó beszerzési ár</th><td>{{ $productdetails->wholeprice }} Ft</td>
<th rowspan=2>Ár</th><td rowspan=2>{{ $productdetails->price }} Ft</td></tr>
<tr><th>Bruttó beszerzési ár</th><td>{{ $productdetails->wholeprice }} Ft</td>
<tr><th>Vonalkód</th><td>{{ $productdetails->barcode }}</td><th>Raktáron</th><td>{{ $productdetails->count }} {{ $productdetails->dimension }}</td></tr>
<tr><th>Elhelyezkedés</th><td>{{ $productdetails->whereis }} {{ $productdetails->whereis2 }}</td><th>Küszöb</th><td>{{ $productdetails->threshold }} {{ $productdetails->dimension }}</td></tr>
<tr><th>Utolsó rendelés</th><td> NA </td>
<th>Utolsó vásárlás</th><td> NA </td></tr>
<tr><td colspan=5><a href="stock_productimageupload.php"><button class="button">Kép szerkesztése</button></a>
<a href="stock_productupdate.php"><button class="button">Termék szerkesztése</button></a>
<a href="stock_productcountupdate.php"><button class="button">Mennyiség szabályozása</button></a></td></tr>
</table>
@endsection
我得到了这个错误:
20d205ed160f36c734b8252e44ac81bfa0977988.php 第 6 行中的错误异常: 试图获取非对象的属性
如果我用
替换表格<?php print_r($productdetails);?>
我得到了具有良好值的数组。
出了什么问题?
【问题讨论】:
-
如果你有数组——你为什么要使用
->? -
这是我在 Laravel 的第一个项目,教程展示了这种方法
标签: php html laravel laravel-5.3