Mercurial > pub > Impl
comparison Lib/IMPL/Web/ViewResult.pm @ 260:2879cdb6b8cd
sync
author | sergey |
---|---|
date | Tue, 25 Dec 2012 02:18:59 +0400 |
parents | 32aceba4ee6d |
children | 6b6d4b2275a1 |
comparison
equal
deleted
inserted
replaced
259:b92f19630d33 | 260:2879cdb6b8cd |
---|---|
1 package IMPL::Web::ViewResult; | 1 package IMPL::Web::ViewResult; |
2 use strict; | 2 use strict; |
3 | 3 |
4 use IMPL::Const qw(:prop); | 4 use IMPL::Const qw(:prop); |
5 use Carp qw(carp); | |
5 | 6 |
6 use IMPL::declare { | 7 use IMPL::declare { |
7 base => [ | 8 base => [ |
8 'IMPL::Object' => undef, | 9 'IMPL::Object' => undef, |
9 'IMPL::Object::Autofill' => '@_' | 10 'IMPL::Object::Autofill' => '@_' |
10 ], | 11 ], |
11 props => [ | 12 props => [ |
12 model => PROP_RW, | 13 model => PROP_RW, |
13 location => PROP_RW, | 14 _location => PROP_RW, |
14 cookies => PROP_RW, | 15 cookies => PROP_RW, |
15 headers => PROP_RW, | 16 headers => PROP_RW, |
16 status => PROP_RW | 17 status => PROP_RW |
17 ] | 18 ] |
18 }; | 19 }; |
20 | |
21 sub location { | |
22 carp "location property is absolute"; | |
23 return shift->_location(@_); | |
24 } | |
19 | 25 |
20 1; | 26 1; |
21 | 27 |
22 __END__ | 28 __END__ |
23 | 29 |
33 | 39 |
34 sub HttpGet { | 40 sub HttpGet { |
35 my ($this, $action) = @_; | 41 my ($this, $action) = @_; |
36 | 42 |
37 return IMPL::Web::ViewResult->new( | 43 return IMPL::Web::ViewResult->new( |
38 model => $model, | 44 model => $model |
39 location => $this->location | |
40 ); | 45 ); |
41 } | 46 } |
42 | 47 |
43 =end code | 48 =end code |
44 | 49 |
50 | 55 |
51 =head2 C<[get,set]model> | 56 =head2 C<[get,set]model> |
52 | 57 |
53 Модель ресурса, как правило это результат выполнения C<Http> метода. | 58 Модель ресурса, как правило это результат выполнения C<Http> метода. |
54 | 59 |
55 =head2 C<[get,set]location> | |
56 | |
57 Текущий абсолютный адрес ресурса. | |
58 | |
59 =head2 C<[get,set]cookies> | 60 =head2 C<[get,set]cookies> |
60 | 61 |
61 Хеш с печеньками, которые будут добавлены в C<HTTP> ответ. | 62 Хеш с печеньками, которые будут добавлены в C<HTTP> ответ. |
62 | 63 |
63 =head2 C<[get,set]headers> | 64 =head2 C<[get,set]headers> |