summaryrefslogtreecommitdiff
path: root/demos/quickstart/protected/pages/Database
diff options
context:
space:
mode:
Diffstat (limited to 'demos/quickstart/protected/pages/Database')
-rw-r--r--demos/quickstart/protected/pages/Database/ViewsArUpdate.page28
1 files changed, 28 insertions, 0 deletions
diff --git a/demos/quickstart/protected/pages/Database/ViewsArUpdate.page b/demos/quickstart/protected/pages/Database/ViewsArUpdate.page
new file mode 100644
index 00000000..a2f7ff68
--- /dev/null
+++ b/demos/quickstart/protected/pages/Database/ViewsArUpdate.page
@@ -0,0 +1,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> \ No newline at end of file