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';

   

  =head1 NAME

   

  TranzactiiBursiere::View::Show - Catalyst 
  View

   

  =head1 DESCRIPTION

   

  Catalyst View.

   

  =head1 AUTHOR

   

  A clever guy

   

  =head1 LICENSE

   

  This library is free software, you can 
  redistribute it and/or modify
it under the same terms as Perl 
  itself.

   

  =cut

   

  1;


  And here it is the second one that works 
  (Html.pm):

   

  package 
  TranzactiiBursiere::View::Html;

   

  use strict;
use warnings;
use base 
  'Catalyst::View';

   

  =head1 NAME

   

  TranzactiiBursiere::View::Html - Catalyst 
  View

   

  =head1 DESCRIPTION

   

  Catalyst View.

   

  =head1 AUTHOR

   

  A clever guy

   

  =head1 LICENSE

   

  This library is free software, you can 
  redistribute it and/or modify
it under the same terms as Perl 
  itself.

   

  =cut

   

  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 gives 
  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 
implementations of the "Command" design pattern, or part of a Pipeline pattern, 
instead of a module that is actually instantiated and consumed.  At least 
that's the way I try to make sense of all the different ways you can access 
Catalyst modules.

I'm guessing that the reason Html works is that you actually have a different 
Html modules or Action somewhere in the path that works correctly, and it is 
that module and not the new one you are creating that is getting called.

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
_______________________________________________
List: [email protected]
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to