start_sf5_project/app/templates/debug/source_code.html.twig

36 lines
1.9 KiB
Twig
Raw Permalink Normal View History

2021-04-16 07:37:45 +00:00
<div class="section source-code">
<p>
{{ 'help.show_code'|trans|raw }}
</p>
<button type="button" class="btn btn-default btn-lg btn-block" data-toggle="modal" data-target="#sourceCodeModal">
<i class="fa fa-cogs" aria-hidden="true"></i> {{ 'action.show_code'|trans }}
</button>
<div class="modal fade" id="sourceCodeModal" tabindex="-1">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="{{ 'action.close'|trans }}">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title"><i class="fa fa-code" aria-hidden="true"></i> {{ 'title.source_code'|trans }}</h4>
</div>
<div class="modal-body">
{% if controller %}
<h3><a href="https://symfony.com/doc/current/controller.html" target="_blank">{{ 'title.controller_code'|trans }}</a><small class="pull-right">{{ controller.file_path|format_file(controller.starting_line) }}</small></h3>
<pre><code class="php">{{ controller.source_code }}</code></pre>
{% else %}
<h3><a href="https://symfony.com/doc/current/controller.html">{{ 'title.controller_code'|trans }}</a></h3>
<pre><code>{{ 'not_available'|trans }}</code></pre>
{% endif %}
<h3><a href="https://symfony.com/doc/current/templates.html" target="_blank">{{ 'title.twig_template_code'|trans }}</a><small class="pull-right">{{ template.file_path|format_file(template.starting_line) }}</small></h3>
<pre><code class="twig">{{ template.source_code }}</code></pre>
</div>
</div>
</div>
</div>
</div>