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

Add tip regarding services #1730

Merged
merged 2 commits into from
Sep 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions modules/concepts/services/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,18 @@ If you need more details about dependency injection and how services work in the
their documentation about the [Service Container](https://symfony.com/doc/4.4/service_container.html).
{{% /notice %}}

##### Exclude index.php files when adding wildcard resource

When adding resources with a wildcard to your module namespace, make sure to exclude all `index.php` files (this file is used for security; it is redirecting to FO to prevent reading from the directory). If you don't do it, you might be redirected whenever you open your shop.

```yaml
your_company.your_module:
resource: '../src/*'
exclude:
- '../src/index.php'
- '../src/*/index.php'
```

### Override an existing Symfony service

The container definition can be modified by a module, which enables you to override an existing Symfony service being used in PrestaShop.
Expand Down
Loading