扩展类和受保护的数据

im trying to create a class to manage widgets. I have problems with a protected data in parent class:

Widget.php

/** Parent class **/
class Widget{
    protected $html =""; //formated html data
    // method to load views in {system_path}/widgets/{widget_name}/views/
    protected function LoadView($filename){
        if(!empty($filename) && is_string($filename)){
            $output = "";
            $dir = WIDGET_PATH . "views" . DS . $filename;
            ob_start();
                include($dir);
                $output = ob_get_contents();
            ob_end_clean();
            return $output;
        }
        return NULL;
    }

    //method to render formated html data
    public function Render(){
        if(isset($this->html) && !empty($this->html)){
            return $this->html;
        }
        return NULL;
    }
    //static method to load a Widget
    public static function Load($widgetName){
        if(!empty($widgetName) && is_string($widgetName)){
            $widgetName = strtolower($widgetName);
            if(file_exists(WIDGET_PATH . $widgetName . DS . $widgetName . ".php")){
                include_once(WIDGET_PATH . $widgetName . DS . $widgetName . ".php");
                if(class_exists($widgetName."_Widget")){
                    $class = $widgetName."_Widget";
                    return new $class();
                }
            }
        }
        return FALSE;
    }

}

/widgets/socialbar.php

/** SocialBar Widget **/
class Socialbar_Widget extends Widget
{   
    public function __construct(){
        $this->html = "demo"; // test to see if it works
    }
}

index.php

/*load class files, etc */
$Social = Widget::Load("socialbar"); //works, perfectly loads Socialbar_Widget()

var_dump($social); // works : object(Socialbar_Widget)[29] protected html = 'demo' ......

$Social->Render(); // throws Fatal error: Using $this when not in object context

To extend a variable inside parent class should i use "public"? Or what i mistake. Thanks for help guys.

Your class name is class Socialbar_Widget, Your are calling it in lower case

$Social = Widget::Load("socialbar")

and in load method you are doing strtolower($widgetName).
Check class file name.php. Load function may have returning false.