Magento: Find Which Class Is Responsible For The Template

Just found out a really quick and easy way to figure out which Magento PHP Class is responsible for putting together everything that is needed for any given template. It’s as easy as dropping in one simple line of code. Just place the following into any .phtml template files:

<?php echo 'This Template\'s Class: '.get_class($this); ?>
This entry was posted in Magento. Bookmark the permalink.

2 Responses to Magento: Find Which Class Is Responsible For The Template

  1. Josh Pratt says:

    Very nice! Thanks Branko! That definitely is helpful.

  2. If you are using more text edit approach to developemnt, you can find use in stuff like

    <?php
    echo ‘

    '; print_r(get_class_methods(get_class($this)));  echo '

    ‘;
    ?>

    or

    <?php
    echo ‘

    '; print_r($this->debug());  echo '

    ‘;
    ?>

    or

    <?php
    echo ‘

    '; Zend_Debug::dump($this);  echo '

    ‘;
    ?>