8000 [Question] Where should the old app/Resources/ contents live now? · Issue #40 · symfony/flex · GitHub
[go: up one dir, main page]

Skip to content

[Question] Where should the old app/Resources/ contents live now? #40

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

Closed
8000
javiereguiluz opened this issue Apr 6, 2017 · 9 comments
Closed

Comments

@javiereguiluz
Copy link
Member

I'm switching the Symfony Demo app to Symfony Flex. I don't know what's the new practice to store the old app/Resources/* contents.

For example, app/Resources/views/ are now templates/ but what about:

  • Translation files:
    app/Resources/translations/ -> translations/ ?
  • Overridden bundle templates, for example error pages:
    app/Resources/TwigBundle/views/Exception/ -> ??
  • Web assets (it's common to store the sources of the assets in that dir)
    app/Resources/assets/ -> assets/ ?
@fabpot
Copy link
Member
fabpot commented Apr 6, 2017

For now, it works if you put Resources/ under src/. That's because the directory is determined based on the location of Kernel.php. I want to introduce a new getProjectDir() that would be the directory where composer.json is stored to avoid issues, but I didn't had time for 3.3. I might try to submit a PR today though.

@fabpot
Copy link
Member
fabpot commented Apr 6, 2017

See symfony/symfony#22315

@yakobe
Copy link
yakobe commented Jul 6, 2017

@javiereguiluz Sorry for picking up on a closed Question but could you share where app/Resources/TwigBundle/views/Exception/ templates should be using the flex structure? I cannot get the override working and i've tried several configurations.
Many thanks.

@fabpot
Copy link
Member
fabpot commented Jul 7, 2017

@yakobe Try src/Resources/TwigBundle/views/Exception/, that should work.

@javiereguiluz
Copy link
Member Author

Just saying: I would expect this to live in templates/TwigBundle/Exception/...

(and if I want to overwrite a translation file: translations/TwigBundle/messages... and overwrite an asset: assets/TwigBundle/scss/..., etc.)

@Pierstoval
Copy link
Contributor
Pierstoval commented Jul 7, 2017

Just saying: I would expect this to live in templates/TwigBundle/Exception/...

Yep, maybe the TwigBundle's extension can be updated to be able to change kernel.root_dir into a configurable parameter?

(and if I want to overwrite a translation file: translations/TwigBundle/messages... and overwrite an asset: assets/TwigBundle/scss/..., etc.)

Overriding translations is possible by adding a file in the translations directory with the same translation domain name as the bundle's one, the latest translation will be used in the translator, so no need for directories if the bundle defines translation domains different than the bundle itself.

For assets, it's more an Encore problem, and I'm not sure that it would be easily solvable...

@BPScott
Copy link
BPScott commented Jul 7, 2017

At risk of reopening old discussions: following #56, it seems Flex is moving towards a skeleton style structure with renaming web->public and etc->config.

Skeleton also suggests making a resources/ folder at the root for rather than storing things in src/Resources/. Is it also worth following that convention?

@yakobe
Copy link
yakobe commented Jul 7, 2017

@fabpot Thanks, that works 👍

I also agree with @javiereguiluz 's expectation that they would be in templates/TwigBundle/Exception/.... It looks a little bit funky to have them in src now that we have a templates/ directory.

@fabpot
Copy link
Member
fabpot commented Jul 8, 2017

Of course... and we thought about that as well... see symfony/symfony#23339

tgalopin pushed a commit to tgalopin/flex that referenced this issue Dec 3, 2020
This PR was merged into the master branch.

Discussion
----------

Add a note about the contrib repo

Commits
-------

7a172be added a note about the contrib repo
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

5 participants
0