Skip to content

Explain how to override the default templates directory #7844

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

Merged
merged 1 commit into from
May 11, 2017

Conversation

javiereguiluz
Copy link
Member

This fixes #4714.


If your templates are not stored in the default ``app/Resources/views/``
directory, use the :ref:`twig.paths <config-twig-paths>` configuration option to
define your own templates directory (or directories):
Copy link
Contributor

Choose a reason for hiding this comment

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

What about mentioning the root dir here? Either via a note or %kernel.root_dir%/Resources/views/ instead of app/Resources/views/. This will be one of the things people will forget to change once they move their kernel to src/. People already are in the process of doing so now that the structure for 4.0 has been presented.

Copy link
Contributor

Choose a reason for hiding this comment

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

What about mentioning the root dir here? Either via a note or %kernel.root_dir%/Resources/views/ instead of app/Resources/views/.

I agree we should explicit it at some point but I don 't think this is the right place to do so, since other resources are concerned (i.e translations).

The whole Resources folder should be relative to the kernel root dir.

Copy link
Contributor

@HeahDude HeahDude left a comment

Choose a reason for hiding this comment

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

👍 LGTM

@weaverryan
Copy link
Member

👍

@xabbuh
Copy link
Member

xabbuh commented May 11, 2017

Thank you Javier.

@xabbuh xabbuh merged commit 10dec72 into symfony:2.7 May 11, 2017
xabbuh added a commit that referenced this pull request May 11, 2017
…javiereguiluz)

This PR was merged into the 2.7 branch.

Discussion
----------

Explain how to override the default templates directory

This fixes #4714.

Commits
-------

10dec72 Explain how to override the default templates directory
xabbuh added a commit that referenced this pull request May 11, 2017
xabbuh added a commit that referenced this pull request May 11, 2017
* 2.7:
  [#7844] add XML and PHP config examples
  Property access
  fix remaining setDefinition() call
  mention old way to create PHPUnit mock objects
  Explain how to override the default templates directory
  Added a new article about linting translation files
  Removed any reference to X-Status-Code
xabbuh added a commit that referenced this pull request May 11, 2017
* 2.8:
  [#7844] add XML and PHP config examples
  Property access
  fix remaining setDefinition() call
  mention old way to create PHPUnit mock objects
  Explain how to override the default templates directory
  Added a new article about linting translation files
  Removed any reference to X-Status-Code
xabbuh added a commit that referenced this pull request May 11, 2017
* 3.2:
  Documented the getIterator() method
  [#7844] add XML and PHP config examples
  Property access
  fix remaining setDefinition() call
  mention old way to create PHPUnit mock objects
  Explain how to override the default templates directory
  Added a new article about linting translation files
  Removed any reference to X-Status-Code
weaverryan added a commit that referenced this pull request May 20, 2017
* origin/2.7: (51 commits)
  Avoid backticks in shell scripts
  Update optional_dependencies.rst
  Fix xml blocks
  [#7875] minor tweaks
  Minor fix
  Minor changes
  [#7773] fix line length
  Add helpful remarks on custom DataCollector
  Remove use of deprecated security.exception_listener.class parameter
  Update resources.rst
  Fix incoherent ut8mb4 collation in Doctrine setup
  Fix decorating service definition
  fix empty XML element
  [#7873] add missing toctree entries
  Reworded the introduction of the contributing docs
  [#7844] add XML and PHP config examples
  Property access
  [HttpFoundation] Fix clearstatcache first arg
  Explain how to provide a stack trace
  fix remaining setDefinition() call
  ...
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.

6 participants