[Catalyst] Web parts

Kyoko Shikamata shikamata at shoeisha.co.jp
Wed Apr 15 10:41:10 GMT 2009


Hi,

How do you design web parts ?

I'm using C::P::SubRequest in my project.

Ex:
<html>
<body>
  <div id="main">
   Hello
  </div>
  <div id="right">
    [% c.subreq('/parts/ranking') %]
  </div>
</bod>
</html>

package MyApp::Controller::Parts::Ranking;
......
sub index : Local {
    my ( $self, $c ) = @_;
    $c->stash->{data} = 
         $c->model('Products')
         ->search({},
          {order_by => 'sales DESC' });
    $c->stash->{template} = 'parts/ranking.tt';
    $c->forward($c->view('TT'));
}
1;

But, 
When I use C::P::PageCache, C::P::SubRequest sometimes is not executed.
I cannot find the cause.
So, I'm looking for other methods.
Pls teach me the good design.


I apologize for my poor English.
---
Kyoko Shikamata





More information about the Catalyst mailing list