我有一个催化剂特定的模型类,我想要实现 通过在Catalyst :: Model :: Adapter
的帮助下包装它package MyClass;
use Moose;
has 'c' => ( is => 'ro' , isa => 'Catalyst' );
1;
package MyAPP::Model::MyClass
use base 'Catalyst::Model::Adaptor';
sub prepare_arguments {
my ($self, $app) = @_; # $app sometimes written as $c
return { c => $app };
}
1;
问题是这里$ app不是MyAPP的实例,只是 班级名称'MyApp'。
如何从此方法访问MyApp实例?