Parsed documentation:
View on GitHub
Renders a template only if it exists.

Same as `render/3`, but returns `nil` instead of raising.
Useful for dynamically rendering templates in the layout that may or
may not be implemented by the `@inner` view.

## Examples

Consider the case where the application layout allows views to dynamically
render a section of script tags in the head of the document. Some views
may wish to inject certain scripts, while others will not.

      <%= render_existing view_module(@conn), "scripts.html", assigns %>

Then the module for the `@inner` view can decide to provide scripts with
either a precompiled template, or by implementing the function directly, ie:

    def render("scripts.html", _assigns) do
      "<script src="...">"

To use a precompiled template, create a `scripts.html.eex` file in the `templates`
directory for the corresponding view you want it to render for. For example,
for the `UserView`, create the `scripts.html.eex` file at `web/templates/user/`.

## Rendering based on controller template

In some cases, you might need to render based on the template from the controller.
For these cases, `Phoenix.Controller.controller_template/1` can pair with
`render_existing/3` for per-template based content, ie:

      <%= render_existing view_module(@conn), "scripts." <> controller_template(@conn), assigns %>

    def render("", _assigns) do
      "<script src="...">"
    def render("scripts.index.html", _assigns) do
      "<script src="...">"
Please help! Open an issue on GitHub if this assessment is incorrect.