Dave Howorth wrote:
> Christopher Rankin wrote:
>> My application keeps giving me the following error when I try to load my 
>> user model class. 
> ...
>>  failed to resolve handler `Raymond': Invalid CODE attribute: Exported 
>> at /usr/local/src/Raymond/lib//Raymond/User.pm line 3
> ...
>> package Raymond::User;
> 
> use base qw(Maypole::Model::CDBI);
> 
>> sub logout :Exported {
>>
>> my ($class, $r) = @_;
>>
>> Maypole::Plugin::Authentication::UserSessionCookie::logout($r);
>>
>> $r->template('login');
>>
>> }
>>
>> 1;
> 
> You need to make your User class part of the model, so it knows about 
> the Exported attribute. It needs to inherit from the model class. Add 
> the line I've shown above.
> 
> I think the Model manual could be clearer. The example at the bottom of 
> http://search.cpan.org/~teejay/Maypole-2.11_pre3/lib/Maypole/Manual/Model.pod 
> could usefully have a use base.

You could also add the attribute later by invoking attributes::import 
directly, which I've used on a couple occasions to lvalue-ise a generated 
accessor. It's almost always better not to do it that way though.

-- 
      Matt S Trout       Offering custom development, consultancy and support
   Technical Director    contracts for Catalyst, DBIx::Class and BAST. Contact
Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more information

+ Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Maypole-users mailing list
Maypole-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/maypole-users

Reply via email to