Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
in Q2A Core by

I want to save some theme options inside qa_html_theme class, so user can easily set them by editing qa-theme.php .

something like:

    class qa_html_theme extends qa_html_theme_base
    var $twitterID = "towhidn";

        function sidepanel()
            $this->output('<DIV CLASS="qa-sidepanel">');

            $this->widgets('side', 'top');
            $this->output('<DIV CLASS="qa-twitter">');


            $this->widgets('side', 'high');
            $this->nav('cat', 1);
            $this->widgets('side', 'low');
            $this->widgets('side', 'bottom');
            $this->output('</DIV>', '');



my knowledge of PHP and extends classes failed me, here is the errors that i got :

Notice: Undefined variable: twitterID >>> on definning variable
Fatal error: Cannot access empty property >>> using it inside function

1 Answer

+1 vote
selected by
Best answer

Inside classes you need to refer to the class variables as $this->variable. So in your case it would be


damn, I used $this->$twitterID before. thanks Scott.