0

I've been using Magento 2 to do some theme development and I'm wracking my brain trying to find documentation for block classes. I've been digging through Block folders and stuff. I'm wondering if there's any documentation for the module Block classes.

Example: I needed to know how to get description from product. I basically had to dig around to see how it was being done for another block and copy Magento\Catalog\Block\Product\View to the block. Is there anywhere I can find the methods of this class?

Thanks for any and all help.

1 Answer 1

0

I guess what you ask is how do you know what Data you can pull out for given product (Or when you are in category what Category data you can pull out)

Since Views are getting data from it's Model, You need to refer the Model of the given class.

For example in product, you need to look at the Product Model

Magento\Catalog\Model\Product

Or you can even refer Product Data Interface Magento\Catalog\Api\Data\ProductInterface

By this way you can find out what data can be output from any Model

Hope this helps.

1
  • Thanks for the feedback. This helped me a lot. It may seem simple but in the Magento world things can be very confusing at first.
    – KJ Bonds
    Aug 10, 2016 at 20:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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