I have a custom class 'class ProductsList extends\Magento\CatalogWidget\Block\Product\ProductsList' and wonder where is the physical file containing the class?

Looking at the top level composer file, I see

    "autoload": {
    "psr-4": {
        "Magento\\Framework\\": "lib/internal/Magento/Framework/",
        "Magento\\Setup\\": "setup/src/Magento/Setup/",
        "Magento\\": "app/code/Magento/"

... but when I look in the 'lib/internal' directory, there's no 'Magento/Framework'. Same goes for "Magento\": "app/code/Magento/"

What I do see in the project directory structure is 'vendor/magento/framework'

I looked at the project structure of Magento in GitHub at https://github.com/magento/magento2/tree/develop/lib/internal/Magento/Framework and there's the directory mapping I expected.

I'm trying to make sense of what I think the composer file is telling me and why the physical directory structure is not what I expect it to be.

PS: new to both php and Magento

| improve this question | | | | |
  • 1
    It will be in your vendor folder @vector. You will find all magento module under magento folder. Here is your framework path : \vendor\magento\framework – Bhupendra Jadeja May 6 '17 at 3:16
class ProductsList extends\Magento\CatalogWidget\Block\Product\ProductsList

this would tell you exactly where it lies.

class ProductList - File ProductList.php in your custom module placed at app/code/NameSpace/ModuleName/Block

extends \Magento\CatalogWidget\Block\Product\ProductsList - this particular class can be found in a file placed at vendor/magento/module-catalog-widget/Block/Product/ProductList.php

| improve this answer | | | | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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