Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.
For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email firstname.lastname@example.org.
I notice that within every template of magento. almost 99% of all the code has a ($this->) in it to call methods. This makes me to believe that some how some way every template is included within some sort of class. My question is how do they have it structured to do that ?
All the classes are extended off of a few main ones using inheritance. If you are referring to the templates, that is controlled by the Block code and the variables that are available to the templates are via the assign() function in the Block code.