Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DI: Explain how to use search extension in usage outside of nette framework #971

Open
berbeflo opened this issue Mar 23, 2023 · 1 comment

Comments

@berbeflo
Copy link
Contributor

I just played around with nette/di. As I tried to configure the search feature, I've got the following error:
Fatal error: Uncaught Nette\DI\InvalidConfigurationException: Found section 'search' in configuration, but corresponding extension is missing.

In the docs there is no mention of the need to enable this extension first. But as we had the section about extensions above, I tried to add the extension search to the DIC.
The next error was: Fatal error: Uncaught Nette\DI\InvalidConfigurationException: Found section 'extensions' in configuration, but corresponding extension is missing

So I had to look up the source code of the Compiler to find out how to enable the ExtensionsExtension to extend the DIC with the SearchExtension. And nothing of this is explained in the docs.

So I'd suggest, that there should be at least the hint to add the line

$compiler->addExtension('extensions', new Nette\DI\Extensions\ExtensionsExtension());

if you need to configure extensions in the configuration's extensions section.
Also, it should be mentioned in the documentation for the configuration section search that the extension has to be enabled first.

@dg
Copy link
Member

dg commented Mar 23, 2023

Thanks for the suggestion, you're right. I'll make it up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants