You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
component string or null The name of the component (if different than the static method). This can be used to alias one component to another. ``null`` (defaults to the component name)
72
-
path string or null The relative path within the namespace/folder to look for classes. ``null`` (defaults to the component name)
73
-
instanceOf string or null A required class name to match on the returned instance. ``null`` (no filtering)
74
-
getShared boolean Whether to return a shared instance of the class or load a fresh one. ``true``
75
-
preferApp boolean Whether a class with the same basename in the App namespace overrides other explicit class requests. ``true``
Copy file name to clipboardExpand all lines: user_guide_src/source/general/modules.rst
+7Lines changed: 7 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -191,6 +191,13 @@ with the ``new`` command::
191
191
192
192
Config files are automatically discovered whenever using the **config()** function that is always available.
193
193
194
+
.. note:: We don't recommend you use the same short classname in modules.
195
+
Modules that need to override or add to known configurations in **app/Config/** should use :ref:`registrars`.
196
+
197
+
.. note:: **config()** finds the file in **app/Config/** when there is a class with the same shortname,
198
+
even if you specify a fully qualified class name like ``config(\Acme\Blog\Config\Blog::class)``.
199
+
This is because ``config()`` is a wrapper for the ``Factories`` class which uses ``preferApp`` by default. See :ref:`factories-options` for more information.
0 commit comments