/[Frey]/trunk/lib/Frey/Run.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/lib/Frey/Run.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 180 by dpavlin, Sun Aug 31 18:02:50 2008 UTC revision 213 by dpavlin, Fri Oct 31 19:51:51 2008 UTC
# Line 7  with 'Frey::Web'; Line 7  with 'Frey::Web';
7    
8  Frey::Run - display required form field for Class and run it  Frey::Run - display required form field for Class and run it
9    
10    =head1 DESCRIPTION
11    
12    This object will try to run other Moose objects from your application. It
13    will try to invoke C<html> or C<markup> method on the.
14    
15  =cut  =cut
16    
17  has 'class' => (  has 'class' => (
# Line 17  has 'class' => ( Line 22  has 'class' => (
22    
23  use Data::Dump qw/dump/;  use Data::Dump qw/dump/;
24    
25  sub html {  sub request {
26          my ( $self, $req ) = @_;          my ( $self, $req ) = @_;
27    
28          my %params = $req->params;          my %params = $req->params;
# Line 44  sub html { Line 49  sub html {
49          } else {          } else {
50                  my $o = $class->new( %params );                  my $o = $class->new( %params );
51                  $o->depends if $o->can('depends');                  $o->depends if $o->can('depends');
52                  $html = $o->markup;                  if ( $o->can('request') ) {
53                            warn "## turning over to $o->request";
54                            $o->request( $req );
55                    } elsif ( $o->can('markup') ) {
56                            warn "## using $o->markup";
57                            $html = $o->markup;
58                            warn ">>> markup $class ",length( $html ), " bytes\n";
59                    } else {
60                            $html = "IGNORE: $class ", $o->dump;
61                            warn $html;
62                    }
63          }          }
64    
         warn ">>> markup $class ",length( $html ), " bytes\n";  
65          $req->print( $self->page( title => $class, body => $html ) );          $req->print( $self->page( title => $class, body => $html ) );
66  }  }
67    

Legend:
Removed from v.180  
changed lines
  Added in v.213

  ViewVC Help
Powered by ViewVC 1.1.26