[Catalyst] Componentised actions.

Oleg Pronin syber.rus at gmail.com
Fri Mar 30 10:18:47 GMT 2007


I have

The problem is that i have no physical /shema/list action:

::Controller::Root

sub default : Private {
    .... load template by path,
         i.e. for /schema/list url it processes root/src/schema/list.tt
         (this is because i have many actions which doesn't neet perl work.
Only TT & DBIx::Class)
}



::Controller::Configure

sub index : Private {
     ....
     $c->forward('/schema/list');
}


and i got error
Couldn't forward to command "/schema/list": Invalid action or component.

likely i need to fall in standart dispatch process to do that.
But plugin subrequest executes again auto actions etc. The code is executed
twice.
I need to execute only action i want but i need catalyst to look for it with
all dispatch rules.



2007/3/30, Nilson Santos Figueiredo Junior <acid06 at gmail.com>:
>
> On 3/29/07, Oleg Pronin <syber.rus at gmail.com> wrote:
> > I cannot forward to the list actions because they are not private
> actions
> > (they have its own URLs). In docs 'forward' is for private actions.
>
> If the docs state that, they're wrong. It's perfectly possible to
> forward to public actions.
>
> > For example you can create url-action which edits some objects and
> include
> > it in many templates. This is not like
> > ordinary template toolkit's include - this component can show itself,
> modify
> > data, receive request params etc, like
> > any web page. And this doesnt depend on whether this action is directly
> > called from browser or included in some template.
>
> You could have some thing like this:
>
> sub nice_page : Local {
>    my ($self, $c) =3D @_;
>    $c->forward('object1');
>    $c->forward('object2');
> }
>
> Then, inside nice_page.tt:
>
> [% INCLUDE object1.tt %]
> [% INCLUDE object2.tt %]
>
> Should do exactly what you want. And, well, if it doesn't you can
> always use Catalyst::Plugin::SubRequest.
>
> -Nilson Santos F. Jr.
>
> _______________________________________________
> List: Catalyst at 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/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20070330/873f2=
332/attachment.htm


More information about the Catalyst mailing list