blob: a2f7ff68023d07121165cc56b10421de49f78367 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
<com:TContent ID="body" >
<h1 id="138046">Views - AR Classes Update</h1>
<com:SinceVersion Version="4.0" />
<p class="block-content">
Usually when have <tt>Active Records Classes</tt>
there are correspondingly the proper views to handle them.
</p>
<com:TTextHighlighter CssClass="source block-content">
$student = AR_Student::finder()->findByPk(1);
$this->tryToUpdateView($student);
</com:TTextHighlighter>
<p class="block-content">
Also you can do the reverse operation.
</p>
<com:TTextHighlighter CssClass="source block-content">
$student = new AR_Student();
$this->tryToUpdateAR($student);
$student->save();
</com:TTextHighlighter>
<div class="info"><b class="note">Info:</b>
When an AR class attribute does not match any of the controls IDs on the view, nothing will happen
</div>
</com:TContent>
|