<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="Close">
<span aria-hidden="true">×</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>
|