nerdexam
Adobe

AD0-E724 · Question #57

What are two mandatory files needed to register a custom module? (Choose two.)

The correct answer is C. etc/module.xml D. registration.php. In Magento 2, every custom module requires etc/module.xml (C) to declare the module's name and sequence/dependencies, and registration.php (D) to register the module with Magento's component registry using \Magento\Framework\Component\ComponentRegistrar::register(). Without…

Setup and Configuration

Question

What are two mandatory files needed to register a custom module? (Choose two.)

Options

  • Aregistration.xml
  • Bregister.php
  • Cetc/module.xml
  • Dregistration.php

How the community answered

(21 responses)
  • A
    5% (1)
  • B
    5% (1)
  • C
    90% (19)

Explanation

In Magento 2, every custom module requires etc/module.xml (C) to declare the module's name and sequence/dependencies, and registration.php (D) to register the module with Magento's component registry using \Magento\Framework\Component\ComponentRegistrar::register(). Without both files, Magento will not recognize or load the module.

Why the distractors are wrong:

  • A. registration.xml - This file does not exist in Magento 2's module system; it's a fabricated distractor.
  • B. register.php - The correct filename is registration.php (with the full word "registration"); register.php is not a valid Magento file.

Memory tip: Think of it as a two-step handshake - registration.php introduces the module to Magento's autoloader, while etc/module.xml describes it (name, version, load order). No introduction + no description = no module.

Topics

#module registration#registration.php#module.xml#module files

Community Discussion

No community discussion yet for this question.

Full AD0-E724 Practice