I've written a function that uses debug_backtrace()
to find which methods were called in which PHP files to eventually load a given Block. (Look for the blockBacktrace
method in the Helper class here.)
What I want to do is reverse engineer the layout to be able to find out which layout XML file declared a given block and defined what block should be it's parent. While it's not a requirement, I would also love to be able to detect blocks which were generated by the CMS and have their XML stored in the database.
Is there a good way available in Magento to reverse engineer the layout to get this information from within a block? My eventual goal is to be able to call a Helper method from within a block which generates output that tells the developer how that block came to be where it is.
Thank you.