Skip to content

Commit

Permalink
Using the url() method
Browse files Browse the repository at this point in the history
In order to increase the flexibility of the deployment destination, use url() instead of writing it directly.
  • Loading branch information
s-ohnishi committed May 14, 2024
1 parent fb5d911 commit 6d6d2ae
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions themes/invo/layouts/main.volt
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
<ul class="navbar-nav mr-auto">
<li class="nav-item">
{% if session.has('auth') %}
<a class="nav-link" href="/session/end">Log Out</a>
<a class="nav-link" href="{{ url('session/end') }}">Log Out</a>
{% else %}
<a class="nav-link" href="/session/index">Log In/Sign Up</a>
<a class="nav-link" href="{{ url('session/index') }}">Log In/Sign Up</a>
{% endif %}
</li>
</ul>
Expand Down
12 changes: 6 additions & 6 deletions themes/invo/layouts/patial_tabs.volt
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,38 @@
'controller': 'invoices',
'action': 'index',
'title': 'Invoices',
'uri': '/invoices/index'
'uri': 'invoices/index'
],
[
'controller': 'companies',
'action': 'index',
'title': 'Companies',
'uri': '/companies/index'
'uri': 'companies/index'
],
[
'controller': 'products',
'action': 'index',
'title': 'Products',
'uri': '/products/index'
'uri': 'products/index'
],
[
'controller': 'producttypes',
'action': 'index',
'title': 'Product Types',
'uri': '/producttypes/index'
'uri': 'producttypes/index'
],
[
'controller': 'invoices',
'action': 'profile',
'title': 'Your Profile',
'uri': '/invoices/profile'
'uri': 'invoices/profile'
]
] %}

<ul class="nav nav-tabs mb-3">
{% for controller, tab in tabs %}
<li class="nav-item">
<a class="nav-link {% if tab['controller'] == dispatcher.getControllerName()|lower and tab['action'] == dispatcher.getActionName() %}active{% endif %}" href="{{ tab['uri'] }}">
<a class="nav-link {% if tab['controller'] == dispatcher.getControllerName()|lower and tab['action'] == dispatcher.getActionName() %}active{% endif %}" href="{{ url(tab['uri']) }}">
{{ tab['title'] }}
</a>
</li>
Expand Down
2 changes: 1 addition & 1 deletion themes/invo/producttypes/index.volt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</div>
</div>

<form action="/producttypes/search" role="form" method="post">
<form action="{{ url('producttypes/search') }}" role="form" method="post">
<div class="form-group">
<label for="id">Id</label>
{{ tag.inputNumeric('id', '', ['size': 10, 'maxlength': 10, 'class': 'form-control']) }}
Expand Down
2 changes: 1 addition & 1 deletion themes/invo/producttypes/new.volt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<form action="/producttypes/create" role="form" method="post">
<form action="{{ url('producttypes/create') }}" role="form" method="post">
<ul class="pager">
<li class="previous pull-left">
{{ tag.a(url('producttypes'), '&larr; Go Back', [], true) }}
Expand Down

0 comments on commit 6d6d2ae

Please sign in to comment.