[Dancer-users] Version numbers hard coded in templates
Brian E. Lozier
brian at massassi.com
Sat Feb 26 19:04:30 CET 2011
I'm talking about the application generated with dancer -a myapp. If
you go to the page after that you have a link called "About your
application's environment" and when you click it, it expands and shows
perl version, dancer version, etc. The template is called
views/index.tt and the lines are generated at some point and look like
this:
<table>
<tbody>
<tr>
<td>Perl version</td>
<td><tt>5.012002</tt></td>
</tr>
<tr>
<td>Dancer version</td>
<td><tt>1.3011</tt></td>
</tr>
<tr>
<td>Backend</td>
<td><tt><% settings.apphandler %></tt></td>
</tr>
<tr>
<td>Appdir</td>
<td><tt>/home/brian/projects/dancertest2</tt></td>
</tr>
<tr>
<td>Template engine</td>
<td><tt><% settings.template %></tt></td>
</tr>
<tr>
<td>Logger engine</td>
<td><tt><% settings.logger %></tt></td>
</tr>
<tr>
<td>Running environment</td>
<td><tt><% settings.environment %></tt></td>
</tr>
</tbody>
</table>
I think using the dancer_version as you indicated would be a perfect solution.
I had originally generated my app with dancer 1.2xx and later upgraded
to 1.3xx and was confused when I went back to the app and the version
number had not changed. This is not a big deal!
Thanks,
Brian
On Sat, Feb 26, 2011 at 9:15 AM, sawyer x <xsawyerx at gmail.com> wrote:
> On Fri, Feb 25, 2011 at 5:50 PM, Brian E. Lozier <brian at massassi.com> wrote:
>>
>> I realize these pages are meant to
>> be replaced with my code but it would be cool if it would report the
>> version correctly.
>
> If you're referring to the "Powered by Dancer ..." at the bottom of the
> pages, you're absolutely right, and it's now done this way.
> We use a variable that is added by the abstract layer of templates, called
> "dancer_version".
>
> Here's from the main.tt I just scaffolded:
> Powered by <a href="http://perldancer.org/">Dancer</a> <% dancer_version %>
>
> All the best,
> Sawyer.
>
More information about the Dancer-users
mailing list