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 default_path option reference #8549

Merged
merged 2 commits into from
Oct 27, 2017
Merged

Add default_path option reference #8549

merged 2 commits into from
Oct 27, 2017

Conversation

yceruto
Copy link
Member

@yceruto yceruto commented Oct 24, 2017

Copy link
Member

@javiereguiluz javiereguiluz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for documenting this feature!

We'll need an additional comment explaining the difference between default_path and paths. Maybe it's as easy as removing the hardcoded templates/ dir in paths option and replacing it with "the value of the "default_path" option".

I suggest to add in "path" option a list of the directories in the same order used by Symfony. Example:

This option defines the directories where Symfony will look for Twig templates
in addition to the default locations. Symfony looks for the templates in the
following order:

1. The directories defined in this option;
2. The ``src/Resources/views/`` directory of the application;
3. The directory defined in the ``default_path`` option;
4. The ``Resources/views/`` directories of the bundles used in the application.

@yceruto
Copy link
Member Author

yceruto commented Oct 25, 2017

Thanks @javiereguiluz, updated.

@javiereguiluz
Copy link
Member

@yceruto thanks! I have two more comments:

  1. In my previous comment, I made up the priority of Twig directories. I don't know if that's the right order, so we must double check it.
  2. Instead of this comment in the config sample: # The following was added in Symfony 3.4. it's better to add a .. versionadded:: 3.4 directive. Something like this: https://github.com/symfony/symfony-docs/blob/3.3/reference/configuration/framework.rst#json_manifest_path

@yceruto
Copy link
Member Author

yceruto commented Oct 25, 2017

In my previous comment, I made up the priority of Twig directories. I don't know if that's the right order, so we must double check it.

Fixed order.

Instead of this comment in the config sample: # The following was added in Symfony 3.4. it's better to add a .. versionadded:: 3.4 directive.

Done. Thanks!

@yceruto
Copy link
Member Author

yceruto commented Oct 25, 2017

However, there is other paths have not been mentioned here, such as:

  • The src/Resources/<BundleName>/views/ directories to override templates of the bundles used in the application.
  • The <default_path>/bundles/<BundleName>/ directories to override templates of the bundles used in the application (added in 3.4).

Do you think we should add them too?

@weaverryan
Copy link
Member

Hmmm, I don’t think so. Let’s keep/add that info to wherever we talk about overriding bundles. And in that spot, we probably do need to update it for the new paths :). We could do that here or in another pr

@yceruto
Copy link
Member Author

yceruto commented Oct 25, 2017

Agree, so I finished here :)

@xabbuh
Copy link
Member

xabbuh commented Oct 27, 2017

Thank you @yceruto.

@xabbuh xabbuh merged commit 66fd357 into symfony:3.4 Oct 27, 2017
xabbuh added a commit that referenced this pull request Oct 27, 2017
This PR was merged into the 3.4 branch.

Discussion
----------

Add default_path option reference

symfony/symfony#24179

Commits
-------

66fd357 Minor tweaks
af245fc Add default_path option reference
xabbuh added a commit that referenced this pull request Oct 27, 2017
xabbuh added a commit that referenced this pull request Oct 27, 2017
* 3.4: (27 commits)
  [#8549] update ordered list syntax
  Minor tweaks
  Add default_path option reference
  [Form] Add debug:form command to debug page
  Added option to disable type enforcement in serializer
  Explained the possibility of defining custom deprecation messages
  [config] Add a note about deprecated a node
  [#8471] minor reword
  Explained the DomCrawler charset guessing mechanism
  Added a bundle deprecation notice in other articles
  [#8497] fix typo
  Updated Guard article for the GuardAuthenticatorInterface deprecation
  Deprecate auto picking the first provider
  Explain the new ColorType a bit more
  Explain the new TelType a bit more
  add doc for new tel and color types
  Update tags.rst
  Update tags.rst
  Update tags.rst
  Update tags.rst
  ...
@yceruto yceruto deleted the twig branch January 2, 2018 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants