Skip to content

Commit

Permalink
Fix route prefix
Browse files Browse the repository at this point in the history
Regarding best practices, the bundle routes must be prefixed with the bundle alias.
  • Loading branch information
bschultz committed Apr 3, 2024
1 parent ac0add4 commit c08343a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions config/routing/documentation.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/routing https://symfony.com/schema/routing/routing-1.0.xsd">

<route id="_documentation_home" path="/">
<route id="twig_doc_home" path="/">
<default key="_controller">twig_doc.controller.documentation::index</default>
</route>
<route id="_documentation_invalid_components" path="/invalid">
<route id="twig_doc_invalid_components" path="/invalid">
<default key="_controller">twig_doc.controller.documentation::invalidComponents</default>
</route>
<route id="_documentation_component_view" path="/component-view">
<route id="twig_doc_component_view" path="/component-view">
<default key="_controller">twig_doc.controller.documentation::componentView</default>
</route>

Expand Down
6 changes: 3 additions & 3 deletions templates/component/_item.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
<div>
<h4>Category</h4>
<p>
<a href="{{ path('_documentation_home', {'filterQuery': component.mainCategory.name, 'filterType': 'category'}) }}">{{ component.mainCategory.name }}</a>
<a href="{{ path('twig_doc_home', {'filterQuery': component.mainCategory.name, 'filterType': 'category'}) }}">{{ component.mainCategory.name }}</a>
</p>
</div>
<div>
<h4>Sub-Category</h4>
{% if component.category.parent %}
<p>
<a href="{{ path('_documentation_home', {'filterQuery': component.category.name, 'filterType': 'sub_category' }) }}">
<a href="{{ path('twig_doc_home', {'filterQuery': component.category.name, 'filterType': 'sub_category' }) }}">
{{ component.category.name }}
</a>
</p>
Expand All @@ -39,7 +39,7 @@
<h4>Tags</h4>
{% for tag in component.tags %}
<p>
<a href="{{ path('_documentation_home', {'filterQuery': tag, 'filterType': 'tag'}) }}">{{ tag }}</a>
<a href="{{ path('twig_doc_home', {'filterQuery': tag, 'filterType': 'tag'}) }}">{{ tag }}</a>
</p>
{% endfor %}
</div>
Expand Down
4 changes: 2 additions & 2 deletions templates/component/_search.html.twig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<form action="{{ path('_documentation_home') }}" method="get" name="twig_doc_search_form">
<form action="{{ path('twig_doc_home') }}" method="get" name="twig_doc_search_form">
<label for="twig_doc_search_form_filterQuery">Search</label>
<input name="filterQuery" id="twig_doc_search_form_filterQuery" value="{{ filterQuery }}" autocomplete="off"/>
<label for="twig_doc_search_form_filterType">What</label>
Expand All @@ -11,6 +11,6 @@
</select>
<button type="submit" class="btn btn-primary">Search</button>
{% if filterQuery %}
<a href="{{ path('_documentation_home') }}">Show all</a>
<a href="{{ path('twig_doc_home') }}">Show all</a>
{% endif %}
</form>
2 changes: 1 addition & 1 deletion templates/component/_viewport.html.twig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="twig-doc-viewport">
<iframe class="twig-doc-iframe"
src="{{ path('_documentation_component_view', {name: component.name, data: componentData, quantity: 1}) }}"
src="{{ path('twig_doc_component_view', {name: component.name, data: componentData, quantity: 1}) }}"
>
</iframe>
</div>

0 comments on commit c08343a

Please sign in to comment.