I am a dotnet programmer and new to Php, magento. After some struggle now I m able to understand magento flow (layout, blocks, controllers). Now trying to understand phtml files. I know only some basics of php but which not enough for me to understand the phtml files.

So for understanding phtml files do I really need to learn php. If so, please advise me the best article or any other resource to learn php for magento.


PHP for Magento is basically the same as PHP but I'm assuming you want to learn how Magento uses PHP to call certain Classes.

So first of, to make sure you have a good understanding of PHP check out this article. Understanding PHP is essential to working with Magento. Make sure you understand how Object Oriented PHP works as well since Magento only works with classes.

Next to see how Magento calls certain classes and how code is executed head over to this article as it will explain you the basics of how to use classes and code within the Magento structure.

  • net.tutsplus.com/tutorials/php/the-best-way-to-learn-php this link leads to me on subscription based videos. do we have any non subscription videos or tutorials – prasad maganti Oct 23 '13 at 12:53
  • @prasadmaganti - The above link does not lead to the subscription-based portion of the Tutsplus.com site. Here are two more links which will not lead you to subscription-based portions of the Tutsplus.com website: net.tutsplus.com/?s=php and dev.tutsplus.com/categories/php. Definitely spend time watching what Alan Storm has written Su123 gave you a link to Alan Storm. The Inchoo'ers are also cool. Good luck! – ryanF Oct 23 '13 at 18:47

An exercise I found very beneficial to learning how Magento works internally was to build my own class auto-loader from scratch using the techniques used by Magento as a guide. This is going to introduce you to PHP's method for autoloading (Magento using the spl_autoload_register() method instead of __autoload()) which will help you understand a bit more about PHP and autoloading.

Ultimately, .phtml files are just .php files that are used for presentation of HTML with (ideally) very little logic involved. This doesn't really have anything to do with Magento's architecture itself, but instead is a technique used to help maintain Separation of Concerns between the block class and template files.


If you have an average knowledge in php, you can continue with Magento. While you are getting familiar with magento you'll be familiar with php as well. As a very basic step refer http://www.w3schools.com/php/

I think as an initial step watch the fundamentals of Magento video set. It's really worth for a beginner.

At the same time hope following blogs will be useful.







Not the answer you're looking for? Browse other questions tagged or ask your own question.