comparison Lib/IMPL/Web/Application/ControllerUnit.pm @ 127:0dce0470a3d8

In the IMPL::Web::ControllerUnit added the ability to notify a form about a wrong data from a transaction added a relativeUrl function for a usage from a templates IMPL::Web::TT::Form now fully functional
author wizard
date Fri, 11 Jun 2010 20:21:07 +0400
parents c8dfbbdd8005
children 08753833173d
comparison
equal deleted inserted replaced
126:c8dfbbdd8005 127:0dce0470a3d8
114 if ($transform->Errors->Count) { 114 if ($transform->Errors->Count) {
115 $result{state} = STATE_INVALID; 115 $result{state} = STATE_INVALID;
116 } else { 116 } else {
117 $result{state} = STATE_CORRECT; 117 $result{state} = STATE_CORRECT;
118 my $unit = $self->new($action,\%result); 118 my $unit = $self->new($action,\%result);
119 $result{result} = $unit->method(); 119
120 eval {
121 $result{result} = $unit->$method();
122 };
123 if (my $err = $@) {
124 $result{state} = STATE_INVALID;
125 if (eval { $err->isa(typeof IMPL::WrongDataException) } ) {
126 $result{formErrors} = $err->Args;
127 } else {
128 die $err;
129 }
130 }
120 } 131 }
121 } else { 132 } else {
122 $result{state} = STATE_NEW; 133 $result{state} = STATE_NEW;
123 } 134 }
124 135