[Catalyst] reserved words

John Napiorkowski jjn1056 at yahoo.com
Wed Mar 7 21:23:12 GMT 2007




 =

DIV {
MARGIN:0px;}



From: John Napiorkowski =



  This is the error message you get if you create =

  a subclass of Catalyst::View that doesn't implement a process() method.  =

  It probably doesn't have anything to do with the name of the module...

  =

  =

  =

  =

     =


    I have tried:

     =


    perl script/myapp_create.pl view =

    Show

     =


    After restarting the application, it gives that =

    error. If I do instead:

     =


    =

    perl script/myapp_create.pl view =

    Html

     =



    The application works fine after restarting it. =

    Am I doing something wrong?

     =


    Thanks.

     =


    Octavian

     =


  I'd personally be interested in seeing what the generated files look =

  like.  Could you attach them in your response (or post them someplace we =

  can see?)


  Hi,

   =


  Here is the first one (Show.pm):

   =


  package =

  TranzactiiBursiere::View::Show;

   =


  use strict;
use warnings;
use base =

  'Catalyst::View';

   =


  =3Dhead1 NAME

   =


  TranzactiiBursiere::View::Show - Catalyst =

  View

   =


  =3Dhead1 DESCRIPTION

   =


  Catalyst View.

   =


  =3Dhead1 AUTHOR

   =


  A clever guy

   =


  =3Dhead1 LICENSE

   =


  This library is free software, you can =

  redistribute it and/or modify
it under the same terms as Perl =

  itself.

   =


  =3Dcut

   =


  1;


  And here it is the second one that works =

  (Html.pm):

   =


  package =

  TranzactiiBursiere::View::Html;

   =


  use strict;
use warnings;
use base =

  'Catalyst::View';

   =


  =3Dhead1 NAME

   =


  TranzactiiBursiere::View::Html - Catalyst =

  View

   =


  =3Dhead1 DESCRIPTION

   =


  Catalyst View.

   =


  =3Dhead1 AUTHOR

   =


  A clever guy

   =


  =3Dhead1 LICENSE

   =


  This library is free software, you can =

  redistribute it and/or modify
it under the same terms as Perl =

  itself.

   =


  =3Dcut

   =


  1;


   =


  If I just delete the file Show.pm and restart the =

  server, the program works fine, but if I put it back and restart, it give=
s =

  that error.

  I have seen the same thing under Linux and =

  Windows.

   =


  Thanks.

   =






As others have pointed out, when you use $c->forward(...) that target needs=
 a process method.  I try to think of modules that I forward to as being im=
plementations of the "Command" design pattern, or part of a Pipeline patter=
n, instead of a module that is actually instantiated and consumed.  At leas=
t that's the way I try to make sense of all the different ways you can acce=
ss Catalyst modules.

I'm guessing that the reason Html works is that you actually have a differe=
nt Html modules or Action somewhere in the path that works correctly, and i=
t is that module and not the new one you are creating that is getting calle=
d.

When I forward to a view I try to be very explicit like:

$c->forward($c->view('html')) || $c->log->error("Can't find the html view."=
);

I find this helps.  So try looking in your list of installed components to =
see if Html is being matched someplace else.  Also please let me know what =
you goal here is, that way maybe we can advise a bit better.  Good Luck

--John




 =

___________________________________________________________________________=
_________
Sucker-punch spam with award-winning protection. =

Try the free Yahoo! Mail Beta.
http://advision.webevents.yahoo.com/mailbeta/features_spam.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20070307/95ff9=
61f/attachment.htm


More information about the Catalyst mailing list