FAQ
HI All,

I have implemented REST-ful interface to my app using
Catalyst::Controller::Rest;

i have several controllers and ideally i wanted to do something like this,

package MyApp::Controller::RestOne;

use base 'MyApp::Controller::RestParent';

sub thingOne:Path: ActionClass('REST'){}

in the other class,
package MyApp::Controller::RestTwo;

use base 'MyApp::Controller::RestParent';

sub thingTwo:Path: ActionClass('REST'){}

in the base class,

package MyApp::Controller::RestParent;

use base 'Catalyst::Controller::REST';

sub begin:Private{}
....

in my config file, i have
<Controller RestParent>
stash_key rest
<map>
text/html View
text/html TT
text/xml XML::Simple
text/x-yaml YAML
application/json JSON
text/x-json JSON

</map>
</Controller>

and all the subclasses should inherit this config from the parent, and
render the output using TT, however the child classes are using the default
config and renders the output using YAML::HTML,

so ideally what i need is, when a request is made the subclass should use
the config from the parent class and forward to View::TT,

Please let me know, how to do this.

regards,

Prasad.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20100607/1deb18e9/attachment.htm

Search Discussions

  • Tomas Doran at Jun 7, 2010 at 1:14 pm

    On 7 Jun 2010, at 10:15, prasad guna wrote:
    lasses are using the default config and renders the output using
    YAML::HTML,

    so ideally what i need is, when a request is made the subclass
    should use the config from the parent class and forward to View::TT,

    Please let me know, how to do this.
    Put the config you want shared into __PACKAGE__->config inside the
    parent class rather than the config file.

    Other than that, this will work exactly like you expect it to.

    Cheers
    t0m
  • Prasad guna at Jun 7, 2010 at 2:58 pm
    Thanks Tom,

    Its great and quick response and it Works now.

    PG.
    On Mon, Jun 7, 2010 at 2:17 PM, Tomas Doran wrote:

    On 7 Jun 2010, at 10:15, prasad guna wrote:

    lasses are using the default config and renders the output using
    YAML::HTML,

    so ideally what i need is, when a request is made the subclass should use
    the config from the parent class and forward to View::TT,

    Please let me know, how to do this.
    Put the config you want shared into __PACKAGE__->config inside the parent
    class rather than the config file.

    Other than that, this will work exactly like you expect it to.

    Cheers
    t0m



    _______________________________________________
    List: Catalyst@lists.scsys.co.uk
    Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
    Searchable archive:
    http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
    Dev site: http://dev.catalyst.perl.org/
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20100607/e8579cf8/attachment.htm

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedJun 7, '10 at 9:15a
activeJun 7, '10 at 2:58p
posts3
users2
websitecatalystframework.org
irc#catalyst

2 users in discussion

Prasad guna: 2 posts Tomas Doran: 1 post

People

Translate

site design / logo © 2021 Grokbase