Hi,

might not be relevant now but have you tried

$controller->app->renderer->template_for($controller);

For me it returns the directory and file name but not the format and 
handler (i.e. .html.ep is missing)

Allan

On Wednesday, 10 June 2015 12:05:30 UTC-5, Juergen Nickelsen wrote:
>
> On 13.05.2015 19:18, Juergen Nickelsen wrote: 
> > Now I did this (as a helper function): 
> > 
> > sub current_template_name { 
> >         my ($c) = @_; 
> >         my $loghist = $c->app()->log()->{history}; 
> >         my $try = -1; 
> >         my $msg; 
> >         do { 
> >                 $msg = $loghist->[$try--]->[2];; 
> >         } while ($msg =~ m{\"layouts/} && -$try < @{$loghist}); 
> >         $msg =~ s/^[^"]*"(.*)".*/$1/; 
> >         return $msg; 
> > } 
>
> While that hideosity worked, to some degree, I noticed it broke my test 
> cases, once I ran them again. But only if I ran them *not* with "prove 
> -v" -- well, turned out the debug messages don't even show up in the log 
> history when debugging is not turned on. (Now that makes some sense.) 
>
> In this case this code tries to access non-existent entries, and Perl 
> doesn't like that -> the request returned a 500 instead of a 200. 
>
> After giving the idea some thought, I finally refrained from "improving" 
> this function so it would handle that case, and removed it and all the 
> code that used it. I am happy I did that. :-/ 
>
> Regards, Juergen. 
>
> -- 
> <[email protected] <javascript:>> Tel +49.30.838-50740 Fax -450740 
> Zentraleinrichtung fuer Datenverarbeitung, Central Systems (Unix) 
> Freie Universitaet Berlin, Fabeckstrasse 32, 14195 Berlin, DE 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.

Reply via email to