llaumgui Hi, I would like to use a condition based on config.php on my extend.php. Is there a way to get the configuration in extends.php ?
zgq354 For me there are 2 ways to achieve this. resolve the Application instance via $app = resolve(Application::class); then use $app->config('xxxx') to get the configuration, my example. sometimes like you need to control the extenders before the Application booted, you can include the config.php directly, see the code.
llaumgui zgq354 sometimes like you need to control the extenders before the Application booted, you can include the config.php directly, see the code. I have used this solution. Thx.
clarkwinkelmann If you need to call other extenders based on a condition and can wait until the app is booting, you can create your own extender that implements ExtenderInterface, then conditionally create an instance of the extender you need and then call that extender's extend() method with the same parameters you received on your custom extender's extend() method. Example https://github.com/clarkwinkelmann/flarum-pages-generator/blob/f3a4d449393ae259897f3e6edb1e8aaa7cac253b/src/Pages.php#L72