annotate Lib/IMPL/Web/Application/ViewResult.pm @ 214:4683002758aa

sync
author sergey
date Mon, 06 Aug 2012 17:27:47 +0400
parents d6e2ea24af08
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
213
sergey
parents:
diff changeset
1 package IMPL::Web::Application::ViewResult;
sergey
parents:
diff changeset
2 use strict;
sergey
parents:
diff changeset
3
sergey
parents:
diff changeset
4 use IMPL::lang qw(:declare);
sergey
parents:
diff changeset
5 use IMPL::declare {
sergey
parents:
diff changeset
6 base => [
sergey
parents:
diff changeset
7 'IMPL::Web::Application::ActionResult' => '@_'
sergey
parents:
diff changeset
8 ]
sergey
parents:
diff changeset
9 };
sergey
parents:
diff changeset
10
sergey
parents:
diff changeset
11 BEGIN {
sergey
parents:
diff changeset
12 public property model => PROP_ALL;
sergey
parents:
diff changeset
13 }
sergey
parents:
diff changeset
14
sergey
parents:
diff changeset
15 sub CTOR {
sergey
parents:
diff changeset
16 my $this = shift;
sergey
parents:
diff changeset
17 $this->status('200 OK') unless $this->status;
sergey
parents:
diff changeset
18 }
sergey
parents:
diff changeset
19
214
sergey
parents: 213
diff changeset
20 1;
213
sergey
parents:
diff changeset
21
214
sergey
parents: 213
diff changeset
22 __END__
sergey
parents: 213
diff changeset
23
sergey
parents: 213
diff changeset
24 =pod
sergey
parents: 213
diff changeset
25
sergey
parents: 213
diff changeset
26 =head1 NAME
sergey
parents: 213
diff changeset
27
sergey
parents: 213
diff changeset
28 C<IMPL::Web::Application::ViewResult> - Результат для которого требуется создать
sergey
parents: 213
diff changeset
29 представление.
sergey
parents: 213
diff changeset
30
sergey
parents: 213
diff changeset
31 =head1 SYNOPSIS
sergey
parents: 213
diff changeset
32
sergey
parents: 213
diff changeset
33 =begin code
sergey
parents: 213
diff changeset
34
sergey
parents: 213
diff changeset
35 use IMPL::require {
sergey
parents: 213
diff changeset
36 View => 'IMPL::Web::Application::ViewResult'
sergey
parents: 213
diff changeset
37 };
sergey
parents: 213
diff changeset
38
sergey
parents: 213
diff changeset
39 sub ViewItem {
sergey
parents: 213
diff changeset
40 my ($this,$id) = @_;
sergey
parents: 213
diff changeset
41
sergey
parents: 213
diff changeset
42 my $view = View->new(model => $this->items->find($id));
sergey
parents: 213
diff changeset
43 $view->cookies->{'Some cookie'} = 'some value';
sergey
parents: 213
diff changeset
44 return $view;
sergey
parents: 213
diff changeset
45 }
sergey
parents: 213
diff changeset
46
sergey
parents: 213
diff changeset
47 =end code
sergey
parents: 213
diff changeset
48
sergey
parents: 213
diff changeset
49 =head1 DESCRIPTION
sergey
parents: 213
diff changeset
50
sergey
parents: 213
diff changeset
51 Наследует C<IMPL::Web::Application::ActionResult>.
sergey
parents: 213
diff changeset
52
sergey
parents: 213
diff changeset
53 Позволяет сформировать C<HTTP> ответ с указанием расширенных свойств и данных.
sergey
parents: 213
diff changeset
54 Как правило данный класс не требуется использовать на прямую, он создается
sergey
parents: 213
diff changeset
55 системой по-умолчанию для представления результатов методов предметной области.
sergey
parents: 213
diff changeset
56
sergey
parents: 213
diff changeset
57 Следует избегать использование данного класса непосредственно при реализации
sergey
parents: 213
diff changeset
58 предметной области, поскольку она должна быть отделена от контроллеров и
sergey
parents: 213
diff changeset
59 представления.
sergey
parents: 213
diff changeset
60
sergey
parents: 213
diff changeset
61 =head1 MEMBERS
sergey
parents: 213
diff changeset
62
sergey
parents: 213
diff changeset
63 =head2 C<[get,set]model>
sergey
parents: 213
diff changeset
64
sergey
parents: 213
diff changeset
65 Объект для которого необходимо построить представление.
sergey
parents: 213
diff changeset
66
sergey
parents: 213
diff changeset
67 =cut