contao / core-bundle

[READ-ONLY] Contao Core Bundle
GNU Lesser General Public License v3.0
123 stars 58 forks source link

[RFC] Include the src/Resource/contao in contao.resource_pathes #1643

Closed sheeep closed 6 years ago

sheeep commented 6 years ago

Using Symfony Flex you do not have an AppBundle anymore. Therefore it is impossible to load (for example) templates from src/Resource/contao. These changes will add the src/Resource/contao directory hard-coded to the AddResourcePathsPass, like app/Resource/contao is already.

leofeyer commented 6 years ago

According to the Symfony best practices, you are not supposed to use a src/(AppBundle)/Resources folder but only the app/Resources folder:

https://symfony.com/doc/3.4/best_practices/templates.html#template-locations

sheeep commented 6 years ago

👍 You're right. Sorry. Same goes for DCA-Configurations I guess?

// src/Resources/contao/library/Contao/Database/Installer.php
$files = \System::getContainer()->get('contao.resource_finder')->findIn('dca')->depth(0)->files()->name('*.php');
leofeyer commented 6 years ago

As briefly discussed, this is the best option since Symfony 4 does not have an app folder anymore.

leofeyer commented 6 years ago

Thank you @sheeep.

aschempp commented 6 years ago

I don't agree with this, why are the files not in the config folder? Or, following the concept of templates and config in root, why not a contao folder in the root? There is no Resources folder supposed to be in the src dir afaik?

aschempp commented 6 years ago

BTW I changed my mind 😇 https://stackoverflow.com/questions/45239350/how-can-i-override-resources-for-third-party-bundles-in-symfony-4

leofeyer commented 6 years ago

Good find. 👍