Skip to main content
added 7 characters in body
Source Link
7ochem
  • 7.6k
  • 14
  • 52
  • 80

This is the way to go:

"autoload": {
    "files": [ "registration.php" ],
    "psr-4": {
      "Amit\\SamplePage\\": ""
    }
  }

The map function in Composer:

   "extra": {
        "map": [
            [
                "*",
                "Amit/SamplePage"
            ]
        ]
    }

forces tethe extension to be installed in app/codeapp/code. This was used in older beta's of Magento 2. Although this will work, it's not the way Magento loads extensions anymore. If you do not use the map function the extension will be installed in the vendor folder, as it should be.

Registration.phpregistration.php defines the type: theme or extension and registers your theme/extension in Magento 2.

The composer.jsoncomposer.json file is added so the extension can be loaded via composerComposer. It also handles the autoloading for your extension.

This is the way to go:

"autoload": {
    "files": [ "registration.php" ],
    "psr-4": {
      "Amit\\SamplePage\\": ""
    }
  }

The map function in Composer:

   "extra": {
        "map": [
            [
                "*",
                "Amit/SamplePage"
            ]
        ]
    }

forces te extension to be installed in app/code. This was used in older beta's of Magento 2. Although this will work, it's not the way Magento loads extensions anymore. If you do not use the map function the extension will be installed in the vendor folder, as it should be.

Registration.php defines the type: theme or extension and registers your theme/extension in Magento 2.

The composer.json file is added so the extension can be loaded via composer. It also handles the autoloading for your extension.

This is the way to go:

"autoload": {
    "files": [ "registration.php" ],
    "psr-4": {
      "Amit\\SamplePage\\": ""
    }
  }

The map function in Composer:

   "extra": {
        "map": [
            [
                "*",
                "Amit/SamplePage"
            ]
        ]
    }

forces the extension to be installed in app/code. This was used in older beta's of Magento 2. Although this will work, it's not the way Magento loads extensions anymore. If you do not use the map function the extension will be installed in the vendor folder, as it should be.

registration.php defines the type: theme or extension and registers your theme/extension in Magento 2.

The composer.json file is added so the extension can be loaded via Composer. It also handles the autoloading for your extension.

added 7 characters in body
Source Link
Silvan
  • 1.4k
  • 6
  • 33
  • 55

This is the way to go:

"autoload": {
    "files": [ "registration.php" ],
    "psr-4": {
      "Amit\\SamplePage\\": ""
    }
  }

The Composermap function in Composer:

   "extra": {
        "map": [
            [
                "*",
                "Amit/SamplePage"
            ]
        ]
    }

forces te extension to be installed in app/code. This was used in older beta's of Magento 2. Although this will work, it's not the way Magento loads extensions anymore. If you do not use the map function the extension will be installed in the vendor folder, as it should be.

Registration.php defines the type: theme or extension and registers your theme/extension in Magento 2.

The composer.json file is added so the extension can be loaded via composer. It also handles the autoloading for your extension.

This is the way to go:

"autoload": {
    "files": [ "registration.php" ],
    "psr-4": {
      "Amit\\SamplePage\\": ""
    }
  }

The Composer function:

   "extra": {
        "map": [
            [
                "*",
                "Amit/SamplePage"
            ]
        ]
    }

forces te extension to be installed in app/code. This was used in older beta's of Magento 2. Although this will work, it's not the way Magento loads extensions anymore. If you do not use the map function the extension will be installed in the vendor folder, as it should be.

Registration.php defines the type: theme or extension and registers your theme/extension in Magento 2.

The composer.json file is added so the extension can be loaded via composer. It also handles the autoloading for your extension.

This is the way to go:

"autoload": {
    "files": [ "registration.php" ],
    "psr-4": {
      "Amit\\SamplePage\\": ""
    }
  }

The map function in Composer:

   "extra": {
        "map": [
            [
                "*",
                "Amit/SamplePage"
            ]
        ]
    }

forces te extension to be installed in app/code. This was used in older beta's of Magento 2. Although this will work, it's not the way Magento loads extensions anymore. If you do not use the map function the extension will be installed in the vendor folder, as it should be.

Registration.php defines the type: theme or extension and registers your theme/extension in Magento 2.

The composer.json file is added so the extension can be loaded via composer. It also handles the autoloading for your extension.

Source Link
Silvan
  • 1.4k
  • 6
  • 33
  • 55

This is the way to go:

"autoload": {
    "files": [ "registration.php" ],
    "psr-4": {
      "Amit\\SamplePage\\": ""
    }
  }

The Composer function:

   "extra": {
        "map": [
            [
                "*",
                "Amit/SamplePage"
            ]
        ]
    }

forces te extension to be installed in app/code. This was used in older beta's of Magento 2. Although this will work, it's not the way Magento loads extensions anymore. If you do not use the map function the extension will be installed in the vendor folder, as it should be.

Registration.php defines the type: theme or extension and registers your theme/extension in Magento 2.

The composer.json file is added so the extension can be loaded via composer. It also handles the autoloading for your extension.