List Info

Thread: Re: Componentised actions.




Re: Componentised actions.
country flaguser name
United States
2007-03-30 15:07:48

----- Original Message ----
From: Nilson Santos Figueiredo Junior <acid06gmail.com>
To: The elegant MVC web framework <catalystlists.rawmode.org>
Sent: Thursday, March 29, 2007 11:46:48 PM
Subject: Re: [Catalyst] Componentised actions.

On 3/29/07, Oleg Pronin <syber.rusgmail.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) = _;
    $c->forward('object1');
    $c->forward('object2');
  }

I was always nervous about doing this because of my fear
about Stash namespace collision.  To be honest I have a love
hate relationship with the stash because I like the idea of 
having a ready made messaging system but because it's hash
based I feared the feeling I was making a very tightly
coupled application.  You need to know the base stash key
for your stuff, right?  And then it needs to be different
for each action that you think might be in an action chain
or forwarded to as in the example above.

Have you run into this problem, found ways around it or just
don't feel paranoid about it?

--John

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: Catalystlists.rawmode.org
Listinfo: ht
tp://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-
archive.com/catalystlists.rawmode.org/
Dev site: http://dev.catalyst.per
l.org/





 
____________________________________________________________
________________________
No need to miss a message. Get email on-the-go 
with Yahoo! Mail for Mobile. Get started.
http://mobile.yahoo.com/
mail 

_______________________________________________
List: Catalystlists.rawmode.org
Listinfo: ht
tp://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-
archive.com/catalystlists.rawmode.org/
Dev site: http://dev.catalyst.per
l.org/

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )