Skip Menu |

This queue is for tickets about the Catalyst-View-TT CPAN distribution.

Report information
The Basics
Id: 124685
Status: new
Priority: 0/
Queue: Catalyst-View-TT

People
Owner: Nobody in particular
Requestors: rrwo [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Unable to expose methods included as part of a Moo role
Date: Mon, 5 Mar 2018 14:14:07 +0000
To: bug-Catalyst-View-TT [...] rt.cpan.org
From: Robert Rothenberg <rrwo [...] cpan.org>
I have a subclass of Catalys::View::TT, and am including methods from a role using Role::Tiny::With that I want to expose to the template by adding them to the expose_methods attribute. I get an error that the methods don't exist from Catalyst::View::TT. (I've added a die unless $class->can('my_method') to verify the methods are imported, and that wasn''t triggered. I've had to use an ugly workaround: use Class::Method::Modifiers qw/ before /; use Role::Tiny::With; with 'MyRole'; before my_method => sub {}; I'm assuming it might work by rewriting the view to use Moose instead of the old-style mro modification, but was hoping to avoid not rewriting some legacy code.