Webiik allows you to use extensions. Extensions are reusable parts of Webiik application.
composer create-project webiik/extension Extension
⚠️ Code of every extension has to live in its own namespace beginning with letters WE, followed by name of extension folder. For example:
Unlike the main Webiik application, extensions have some limitations:
It doesn’t mean your extension can’t use services or access configuration. If your extension requires some specific service or configuration, you have to add it manually in the main application. These limitations are here to prevent conflicts between extensions and the main application.
To enable the extension, you have to register it within your main application.
$app->run();add the following line:
The first parameter is the name of extension folder inside private/extensions folder, the second parameter is URI of extension within your main application.
"WE\\Admin\\Controller\\": "extensions/Admin/code/controllers", "WE\\Admin\\Middleware\\": "extensions/Admin/code/middleware", "WE\\Admin\\Components\\": "extensions/Admin/code/components", "WE\\Admin\\Model\\": "extensions/Admin/code/models", "WE\\Admin\\Trait\\": "extensions/Admin/code/traits"