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
Copy file name to clipboardExpand all lines: user_guide_src/source/general/modules.rst
+24-1Lines changed: 24 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -101,7 +101,17 @@ This is configured in the file **app/Config/Modules.php**.
101
101
The auto-discovery system works by scanning for particular directories and files within psr4 namespaces that have been defined in **Config/Autoload.php**.
102
102
103
103
To make auto-discovery work for our **Blog** namespace, we need to make one small adjustment.
104
-
**Acme** needs to be changed to **Acme\\Blog** because each "module" within the namespace needs to be fully defined. Once your module folder path is defined, the discovery process would look for discoverable items on that path and should, for example, find the routes file at **/acme/Blog/Config/Routes.php**.
104
+
**Acme** needs to be changed to **Acme\\Blog** because each "module" within the namespace needs to be fully defined.
105
+
106
+
::
107
+
108
+
public $psr4 = [
109
+
APP_NAMESPACE => APPPATH, // For custom namespace
110
+
'Config' => APPPATH . 'Config',
111
+
'Acme\Blog' => ROOTPATH . 'acme/Blog', // Change
112
+
];
113
+
114
+
Once your module folder path is defined, the discovery process would look for discoverable items on that path and should, for example, find the routes file at **/acme/Blog/Config/Routes.php**.
105
115
106
116
Enable/Disable Discover
107
117
=======================
@@ -143,6 +153,19 @@ the **Modules** config file, described above.
143
153
.. note:: Since the files are being included into the current scope, the ``$routes`` instance is already defined for you.
144
154
It will cause errors if you attempt to redefine that class.
145
155
156
+
Filters
157
+
=======
158
+
159
+
By default, :doc:`filters </incoming/filters>` are automatically scanned for within modules.
160
+
It can be turned off in the **Modules** config file, described above.
161
+
162
+
.. note:: Since the files are being included into the current scope, the ``$filters`` instance is already defined for you.
163
+
It will cause errors if you attempt to redefine that class.
164
+
165
+
In the module's **Config/Filters.php** file, you need to define the aliases of the filters you use.::
0 commit comments