[Catalyst] reserved words

Octavian Rasnita orasnita at gmail.com
Thu Mar 8 06:44:57 GMT 2007


Ok, thank you all for your help.

Octavian

  ----- Original Message ----- =

  From: John Napiorkowski =

  To: The elegant MVC web framework =

  Sent: Wednesday, March 07, 2007 11:23 PM
  Subject: Re: [Catalyst] reserved words




  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 instea=
d:

      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 li=
ke.  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 w=
orks 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 nee=
ds 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 patt=
ern, instead of a module that is actually instantiated and consumed.  At le=
ast that's the way I try to make sense of all the different ways you can ac=
cess Catalyst modules.

  I'm guessing that the reason Html works is that you actually have a diffe=
rent 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 cal=
led.

  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 t=
o see if Html is being matched someplace else.  Also please let me know wha=
t you goal here is, that way maybe we can advise a bit better.  Good Luck

  --John



---------------------------------------------------------------------------=
---
  Need Mail bonding?
  Go to the Yahoo! Mail Q&A for great tips from Yahoo! Answers users.


---------------------------------------------------------------------------=
---


  _______________________________________________
  List: Catalyst at lists.rawmode.org
  Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
  Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.or=
g/
  Dev site: http://dev.catalyst.perl.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20070308/6bff3=
d69/attachment-0001.htm


More information about the Catalyst mailing list