Mercurial > pub > Impl
annotate Lib/IMPL/Web/ViewResult.pm @ 369:7c784144d2f1
Implemented object metadata class, cleanup
author | cin |
---|---|
date | Mon, 09 Dec 2013 17:35:34 +0400 |
parents | 6b6d4b2275a1 |
children |
rev | line source |
---|---|
241
f48a1a9f4fa2
+Added ViewResult to allow implementation of the view environment.
sergey
parents:
diff
changeset
|
1 package IMPL::Web::ViewResult; |
f48a1a9f4fa2
+Added ViewResult to allow implementation of the view environment.
sergey
parents:
diff
changeset
|
2 use strict; |
f48a1a9f4fa2
+Added ViewResult to allow implementation of the view environment.
sergey
parents:
diff
changeset
|
3 |
f48a1a9f4fa2
+Added ViewResult to allow implementation of the view environment.
sergey
parents:
diff
changeset
|
4 use IMPL::Const qw(:prop); |
260 | 5 use Carp qw(carp); |
241
f48a1a9f4fa2
+Added ViewResult to allow implementation of the view environment.
sergey
parents:
diff
changeset
|
6 |
f48a1a9f4fa2
+Added ViewResult to allow implementation of the view environment.
sergey
parents:
diff
changeset
|
7 use IMPL::declare { |
f48a1a9f4fa2
+Added ViewResult to allow implementation of the view environment.
sergey
parents:
diff
changeset
|
8 base => [ |
f48a1a9f4fa2
+Added ViewResult to allow implementation of the view environment.
sergey
parents:
diff
changeset
|
9 'IMPL::Object' => undef, |
f48a1a9f4fa2
+Added ViewResult to allow implementation of the view environment.
sergey
parents:
diff
changeset
|
10 'IMPL::Object::Autofill' => '@_' |
f48a1a9f4fa2
+Added ViewResult to allow implementation of the view environment.
sergey
parents:
diff
changeset
|
11 ], |
f48a1a9f4fa2
+Added ViewResult to allow implementation of the view environment.
sergey
parents:
diff
changeset
|
12 props => [ |
244 | 13 model => PROP_RW, |
260 | 14 _location => PROP_RW, |
256
32aceba4ee6d
corrected ViewHandlers to handle cookies and headers.
sergey
parents:
244
diff
changeset
|
15 cookies => PROP_RW, |
32aceba4ee6d
corrected ViewHandlers to handle cookies and headers.
sergey
parents:
244
diff
changeset
|
16 headers => PROP_RW, |
32aceba4ee6d
corrected ViewHandlers to handle cookies and headers.
sergey
parents:
244
diff
changeset
|
17 status => PROP_RW |
241
f48a1a9f4fa2
+Added ViewResult to allow implementation of the view environment.
sergey
parents:
diff
changeset
|
18 ] |
f48a1a9f4fa2
+Added ViewResult to allow implementation of the view environment.
sergey
parents:
diff
changeset
|
19 }; |
f48a1a9f4fa2
+Added ViewResult to allow implementation of the view environment.
sergey
parents:
diff
changeset
|
20 |
260 | 21 sub location { |
22 carp "location property is absolute"; | |
23 return shift->_location(@_); | |
24 } | |
25 | |
244 | 26 1; |
27 | |
28 __END__ | |
29 | |
30 =pod | |
31 | |
32 =head1 NAME | |
33 | |
34 C<IMPL::Web::ViewResult> - описание представления результата. | |
35 | |
36 =head1 SYNOPSIS | |
37 | |
38 =begin code | |
39 | |
40 sub HttpGet { | |
41 my ($this, $action) = @_; | |
42 | |
43 return IMPL::Web::ViewResult->new( | |
260 | 44 model => $model |
244 | 45 ); |
46 } | |
47 | |
48 =end code | |
49 | |
50 =head1 DESCRIPTION | |
51 | |
265 | 52 Сожержит в себе информацию для представления модели. Также включает поля для |
53 заголовков ответа C<cookies>, C<headers>, C<status>. | |
244 | 54 |
55 =head1 MEMBERS | |
56 | |
57 =head2 C<[get,set]model> | |
58 | |
59 Модель ресурса, как правило это результат выполнения C<Http> метода. | |
60 | |
256
32aceba4ee6d
corrected ViewHandlers to handle cookies and headers.
sergey
parents:
244
diff
changeset
|
61 =head2 C<[get,set]cookies> |
32aceba4ee6d
corrected ViewHandlers to handle cookies and headers.
sergey
parents:
244
diff
changeset
|
62 |
32aceba4ee6d
corrected ViewHandlers to handle cookies and headers.
sergey
parents:
244
diff
changeset
|
63 Хеш с печеньками, которые будут добавлены в C<HTTP> ответ. |
32aceba4ee6d
corrected ViewHandlers to handle cookies and headers.
sergey
parents:
244
diff
changeset
|
64 |
32aceba4ee6d
corrected ViewHandlers to handle cookies and headers.
sergey
parents:
244
diff
changeset
|
65 =head2 C<[get,set]headers> |
32aceba4ee6d
corrected ViewHandlers to handle cookies and headers.
sergey
parents:
244
diff
changeset
|
66 |
32aceba4ee6d
corrected ViewHandlers to handle cookies and headers.
sergey
parents:
244
diff
changeset
|
67 Заголовки которые нужно добавить в заголовки C<HTTP> ответа. |
32aceba4ee6d
corrected ViewHandlers to handle cookies and headers.
sergey
parents:
244
diff
changeset
|
68 |
32aceba4ee6d
corrected ViewHandlers to handle cookies and headers.
sergey
parents:
244
diff
changeset
|
69 =head2 C<[get,set]status> |
32aceba4ee6d
corrected ViewHandlers to handle cookies and headers.
sergey
parents:
244
diff
changeset
|
70 |
32aceba4ee6d
corrected ViewHandlers to handle cookies and headers.
sergey
parents:
244
diff
changeset
|
71 Код C<HTTP> ответа. |
244 | 72 |
73 =cut |