【发布时间】:2021-02-18 22:08:00
【问题描述】:
我到处都在做这种事情,没有任何麻烦,但这次没有成功。
var_dump($fields);
结果:
object(stdClass)[880]
public 'teacher_model' =>
object(Backend\Classes\FormField)[754]
public 'fieldName' => string 'teacher_model' (length=13)
public 'arrayName' => string 'Shooting' (length=8)
public 'idPrefix' => string 'Form' (length=4)
public 'label' => string 'Modèle enseignant' (length=18)
public 'value' => string '' (length=0)
public 'valueFrom' => string 'teacher_model' (length=13)
public 'defaults' => null
public 'defaultFrom' => null
public 'tab' => string 'quendistudio.dispose::lang.tab.report' (length=37)
public 'type' => string 'text' (length=4)
public 'options' => null
public 'span' => string 'storm' (length=5)
public 'size' => string 'large' (length=5)
public 'context' => null
public 'required' => boolean false
public 'readOnly' => boolean false
public 'disabled' => boolean false
public 'hidden' => boolean false
public 'stretch' => boolean false
public 'comment' => string '' (length=0)
public 'commentPosition' => string 'below' (length=5)
public 'commentHtml' => boolean false
public 'placeholder' => string '' (length=0)
public 'attributes' => null
public 'cssClass' => string 'col-xs-12 col-md-6 col-lg-4' (length=27)
public 'path' => null
public 'config' =>
array (size=5)
'label' => string 'Modèle enseignant' (length=18)
'span' => string 'storm' (length=5)
'cssClass' => string 'col-xs-12 col-md-6 col-lg-4' (length=27)
'type' => string 'text' (length=4)
'tab' => string 'quendistudio.dispose::lang.tab.report' (length=37)
public 'dependsOn' => null
public 'trigger' => null
public 'preset' => null
看起来不错,但现在有人解释一下吗:
var_dump($fields->teacher_model);
结果:
未定义属性:stdClass::$teacher_model
为什么???
【问题讨论】:
-
试试 $fields[0]->teacher_model
标签: php laravel object octobercms