sukria/Dancer — pull request #716 by bigpresh (2011-12-27 19:00:57+00:00)
Title: More intuitive appending of default template extension, be backwards-compatible

Try the view/layout name as supplied, first, before attempting to append the default template extension (if the name supplied did not already end with it, that is), and document this logic.

This should solve the issue experienced by Nick Knutov:

http://lists.perldancer.org/pipermail/dancer-users/2011-December/002211.html

Older Dancer versions worked for him, but a backwards-incompatible change caused latest versions to stop working - he was giving e.g. `mails/ticket_new.txt` to `template()`, but it was looking for `mails/ticket_new.txt.tmpl`, despite the fact that `mails/ticket_new.txt` existed, which seems counter-intuitive.

I'd appreciate input from the other devs on this; if we agree this is an acceptable solution, please feel free to merge. If you have better ideas on how to handle this, I'd be happy to hear them too :)

I think this is a relatively simple fix which should be pushed out in a new Dancer version.

For Dancer2, I think we need to implement similiar logic (use the view name as-is if a file with that name exists, if not, try appending the default extension). I think we should also clarify the use of "view" and "template" in Dancer2, as in Dancer, the two are used confusingly, I feel.