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

An exception has been thrown during the rendering of a template ("The "hinclude" renderer does not exist."). #34815

Closed
HecFranco opened this issue Dec 4, 2019 · 6 comments

Comments

@HecFranco
Copy link

Symfony version(s) affected: 5.0.1

Description
I include the render_hinclude as indicated by the documentation and it returns this error.

How to reproduce

{% extends 'base.html.twig' %}

{% block title %}Hello FirstController!{% endblock %}

{% block body %}
<style>
    .example-wrapper { margin: 1em auto; max-width: 800px; width: 95%; font: 18px/1.5 sans-serif; }
    .example-wrapper code { background: #F5F5F5; padding: 2px 6px; }
</style>

<div class="example-wrapper">
    <h1>Hello {{ controller_name }}! ✅</h1>
    <!-- begin: add -->
    {{ render_hinclude(controller('App\\Controller\\FirstController::second'), {default: 'Loading...'}) }}
    <!-- end: add -->
    This friendly message is coming from:
    <ul>
        <li>Your controller at <code><a href="{{ 'G:/00.ProjectWeb/symfony-5-by-sample/01.Quick_Start/04.MakerBundle_First_Controller/src/Controller/FirstController.php'|file_link(0) }}">src/Controller/FirstController.php</a></code></li>
        <li>Your template at <code><a href="{{ 'G:/00.ProjectWeb/symfony-5-by-sample/01.Quick_Start/04.MakerBundle_First_Controller/templates/first/index.html.twig'|file_link(0) }}">templates/first/index.html.twig</a></code></li>
    </ul>
</div>
{% endblock %}
@sershp32
Copy link

sershp32 commented Dec 4, 2019

what is render_hinclude ? is it your custom function?

@HecFranco
Copy link
Author

It's part of symfony's documentation. https://symfony.com/doc/current/templating/hinclude.html

@xabbuh
Copy link
Member

xabbuh commented Dec 4, 2019

Can you create a small example project that allows to reproduce your issue?

@HecFranco
Copy link
Author

Add repository with a little example https://github.com/HecFranco/Symfony_Embed_Asynchronous_Content

@xabbuh
Copy link
Member

xabbuh commented Dec 9, 2019

Status: Reviewed

@xabbuh
Copy link
Member

xabbuh commented Dec 9, 2019

see #34888

xabbuh added a commit that referenced this issue Dec 9, 2019
This PR was merged into the 3.4 branch.

Discussion
----------

[TwigBundle] add tags before processing them

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #34815
| License       | MIT
| Doc PR        |

Commits
-------

e1145a7 add tags before processing them
@xabbuh xabbuh closed this as completed Dec 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants