Fatal error: Cannot access empty property in

Fatal error: Cannot access empty property in

新来的,如果我的帖子不正确,请原谅我。我遇到了这个问题:

Fatal error: Cannot access empty property in /home/content/c/a/l/calchrome/html/gallery/php/includes/php/libmanager.php on line 1363

我在这里找不到语法错误;通常这样的事情很明显,但我想不通。这不是常见的 $this->$var 类型错误。

   foreach($cfg['social_plugin'] as $plugin=>$value)
    {
        $social_order[$this->$value['order']] = $plugin;
    }

    ksort($social_order);

    for($a=1;$a<sizeof($social_order)+1;$a++)

  **this is the section with the problem** 
    {
        $obj = $cfg['social_plugin'][$social_order[$a]];
        $list.='<li id="'.$obj['order'].'_'.($a+1).'"><label for="'.$obj['link'].'"><img src="includes/images/'.$obj['image'].'" /> '.$obj['display'].'</label><input name="'.$social_order[$a].'_L" type="text" id="'.$social_order[$a].'_L" value="'.$this->$obj['link'].'" class="sg_form_long"/></li>';     
    }**

    $html.='<div class="sg_setting_box" id="sortable1">
    <h3>- Soical Information -
    <br/><span>Dragging each plugin can re-arrange the order shown in front end</span>
    </h3>


    <ul class="sg_social">'.$list.'</ul>

    </div>';

变化:

$this->$obj['link']

$obj['link']

$this-> 用于当前 class 属性

您应该更改(如果 obj 在您的 class 中定义为 属性) 来自

$this->$obj['link']

$this->obj['link']

OR(如果obj只定义为局部变量)

到 $obj['link']

正如上面建议的答案