FAQ
Hi,

Please tell me how can I find the list of reserved words that cannot be used
as names for views, controllers, models, $c->stash elements...

For example I have seen that the name of the application is also found in
$c->stash->{name}. $c->stash->{template} is also special.

I have also tried to create a view with the name "Show", and I have received
the following error in the browser:

Caught exception in TranzactiiBursiere::View::Show->process
"TranzactiiBursiere::View::Show directly inherits from Catalyst::View. You
need to
inherit from a subclass like Catalyst::View::TT instead.

If I changed the name of that view to "Html", it worked fine, with no
errors...

Thank you.

Octavian

Search Discussions

  • John Napiorkowski at Mar 6, 2007 at 6:46 pm
    ----- Original Message ----
    From: Octavian Rasnita <orasnita@gmail.com>
    To: catalyst@lists.rawmode.org
    Sent: Tuesday, March 6, 2007 12:02:39 PM
    Subject: [Catalyst] reserved words

    Hi,

    Please tell me how can I find the list of reserved words that cannot be used
    as names for views, controllers, models, $c->stash elements...

    For example I have seen that the name of the application is also found in
    $c->stash->{name}. $c->stash->{template} is also special.

    I have also tried to create a view with the name "Show", and I have received
    the following error in the browser:

    Caught exception in TranzactiiBursiere::View::Show->process
    "TranzactiiBursiere::View::Show directly inherits from Catalyst::View. You
    need to
    inherit from a subclass like Catalyst::View::TT instead.

    If I changed the name of that view to "Html", it worked fine, with no
    errors...

    Thank you.

    Octavian

    I didn't know about the "Show" issue that you mentioned but AFAIK there are not really global reserved stuff. 'template' is used by the TT view to set the path to the template so you have to be careful with that. I think the 'template' think bit me once as well. That's really the only stash key I can think of that's special, but if you use something other than TT you should check the docs.

    --john


    _______________________________________________
    List: Catalyst@lists.rawmode.org
    Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
    Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
    Dev site: http://dev.catalyst.perl.org/






    ____________________________________________________________________________________
    Don't pick lemons.
    See all the new 2007 cars at Yahoo! Autos.
    http://autos.yahoo.com/new_cars.html
  • Jason Kohles at Mar 7, 2007 at 4:00 pm

    On Mar 6, 2007, at 12:02 PM, Octavian Rasnita wrote:

    Hi,

    Please tell me how can I find the list of reserved words that
    cannot be used as names for views, controllers, models, $c->stash
    elements...

    For example I have seen that the name of the application is also
    found in $c->stash->{name}. $c->stash->{template} is also special.

    I have also tried to create a view with the name "Show", and I have
    received the following error in the browser:

    Caught exception in TranzactiiBursiere::View::Show->process
    "TranzactiiBursiere::View::Show directly inherits from
    Catalyst::View. You need to
    inherit from a subclass like Catalyst::View::TT instead.

    If I changed the name of that view to "Html", it worked fine, with
    no errors...
    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...

    --
    Jason Kohles
    email@jasonkohles.com
    http://www.jasonkohles.com/
    "A witty saying proves nothing." -- Voltaire


    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20070307/78c31be0/attachment.htm
  • Octavian Rasnita at Mar 7, 2007 at 5:05 pm
    From: Jason Kohles


    Hi,


    Please tell me how can I find the list of reserved words that cannot be used as names for views, controllers, models, $c->stash elements...


    For example I have seen that the name of the application is also found in $c->stash->{name}. $c->stash->{template} is also special.


    I have also tried to create a view with the name "Show", and I have received the following error in the browser:


    Caught exception in TranzactiiBursiere::View::Show->process "TranzactiiBursiere::View::Show directly inherits from Catalyst::View. You need to
    inherit from a subclass like Catalyst::View::TT instead.


    If I changed the name of that view to "Html", it worked fine, with no errors...




    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
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20070307/de21105c/attachment.htm
  • John Napiorkowski at Mar 7, 2007 at 5:35 pm
    ----- Original Message ----
    From: Octavian Rasnita <orasnita@gmail.com>
    To: The elegant MVC web framework <catalyst@lists.rawmode.org>
    Sent: Wednesday, March 7, 2007 12:05:35 PM
    Subject: Re: [Catalyst] reserved words







    From: Jason Kohles







    Hi,




    Please tell me how can I find the list of reserved
    words that cannot be used as names for views, controllers, models,
    $c->stash elements...




    For example I have seen that the name of the
    application is also found in $c->stash->{name}.
    $c->stash->{template} is also special.




    I have also tried to create a view with the name
    "Show", and I have received the following error in the browser:




    Caught exception in
    TranzactiiBursiere::View::Show->process "TranzactiiBursiere::View::Show
    directly inherits from Catalyst::View. You need to

    inherit from a subclass like Catalyst::View::TT
    instead.




    If I changed the name of that view to "Html", it
    worked fine, with no errors...








    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?)

    --John

    _________________________________________
    List: Catalyst@lists.rawmode.org
    Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
    Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
    Dev site: http://dev.catalyst.perl.org/








    ____________________________________________________________________________________
    Looking for earth-friendly autos?
    Browse Top Cars by "Green Rating" at Yahoo! Autos' Green Center.
    http://autos.yahoo.com/green_center/
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20070307/424238e0/attachment.htm
  • Octavian Rasnita at Mar 7, 2007 at 7:09 pm
    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.
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20070307/9a4ede2d/attachment-0001.htm
  • Eden Cardim at Mar 7, 2007 at 7:51 pm

    On 3/7/07, Octavian Rasnita wrote:
    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.
    You'd get along a lot better if you actually read the docs and error messages.
    You can't forward to a Catalyst View that doesn't implement a
    process() method or it'll throw an exception, which was just what
    happened in your case.

    You probably need to run:

    script/myapp_create.pl view MyView TT

    To create a TT view that has a process() method implemented. Or just
    change TT to whatever type of view you want. Either that or implement
    a process() method yourself.

    --
    Eden Cardim
    Instituto Baiano de Biotecnologia
    N?cleo de Biologia Computacional e Gest?o de Informa??es Biotecnol?gicas
    Laborat?rio de Bioinform?tica
    --
    "you seem to think that 'close enough' is close enough...
    please learn to be 'literal' around programming."
    merlyn - on irc.freenode.net#perl

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedMar 6, '07 at 5:02p
activeMar 7, '07 at 7:51p
posts7
users4
websitecatalystframework.org
irc#catalyst

People

Translate

site design / logo © 2021 Grokbase