summaryrefslogtreecommitdiff
path: root/demos/quickstart/protected/pages
diff options
context:
space:
mode:
authorxue <>2006-05-04 20:00:46 +0000
committerxue <>2006-05-04 20:00:46 +0000
commit42df6f47862c2f1495ded49f758dbc46f9d9e930 (patch)
treeee849b9758bcbd5c1b1aac40761ce68417eba2bb /demos/quickstart/protected/pages
parentc00193d23726bcb05b1fe53c4dfb3fc38b0a22e5 (diff)
Merge from 3.0 branch till 1023.
Diffstat (limited to 'demos/quickstart/protected/pages')
-rw-r--r--demos/quickstart/protected/pages/Advanced/State.page4
-rw-r--r--demos/quickstart/protected/pages/Controls/NewControl.page6
-rw-r--r--demos/quickstart/protected/pages/Controls/Samples/LabeledTextBox2/LabeledTextBox.php2
3 files changed, 6 insertions, 6 deletions
diff --git a/demos/quickstart/protected/pages/Advanced/State.page b/demos/quickstart/protected/pages/Advanced/State.page
index 30d5b2fc..8d69d6a4 100644
--- a/demos/quickstart/protected/pages/Advanced/State.page
+++ b/demos/quickstart/protected/pages/Advanced/State.page
@@ -27,7 +27,7 @@ $caption = $this->getViewState('Caption');
Control state is like view state in every aspect except that control state cannot be disabled. Control state is intended to be used for storing crucial state information without which a page or control may not work properly.
</p>
<p>
-To store and retrieve a variable in control state, use the followign commands,
+To store and retrieve a variable in control state, use the following commands,
</p>
<com:TTextHighlighter CssClass="source">
$this->setControlState('Caption',$caption);
@@ -39,7 +39,7 @@ $caption = $this->getControlState('Caption');
Application state refers to data that is persistent across user sessions and page requests. A typical example of application state is the user visit counter. The counter value is persistent even if the current user session terminates. Note, view state and control state are lost if the user requests for a different page, while session state is lost if the user session terminates.
</p>
<p>
-To store and retrieve a variable in application state, use the followign commands,
+To store and retrieve a variable in application state, use the following commands,
</p>
<com:TTextHighlighter CssClass="source">
$application->setGlobalState('Caption',$caption);
diff --git a/demos/quickstart/protected/pages/Controls/NewControl.page b/demos/quickstart/protected/pages/Controls/NewControl.page
index 61209b6b..51d0cc02 100644
--- a/demos/quickstart/protected/pages/Controls/NewControl.page
+++ b/demos/quickstart/protected/pages/Controls/NewControl.page
@@ -13,7 +13,7 @@ In general, there are two ways of writing new controls: composition of existing
Composition is the easiest way of creating new controls. It mainly involves instantiating existing controls, configuring them and making them the constituent components. The properties of the constituent components are exposed through <a href="?page=Fundamentals.Components">subproperties</a>.
</p>
<p>
-One can compose a new control in two ways. One is to override the <tt>TControl::createChildControls()</tt> method. The other is to extend <tt>TTemplateControl</tt> (or its child classes) and write a control template. The latter is easier to use and can organize the layout constituent compoents more intuitively, while the former is more efficient because it does not require parsing of the template.
+One can compose a new control in two ways. One is to extend <tt>TCompositeControl</tt> and override the <tt>TControl::createChildControls()</tt> method. The other is to extend <tt>TTemplateControl</tt> (or its child classes) and write a control template. The latter is easier to use and can organize the layout constituent compoents more intuitively, while the former is more efficient because it does not require parsing of the template.
</p>
<p>
As an example, we show how to create a labeled textbox called <tt>LabeledTextBox</tt> using the above two approaches. A labeled textbox displays a label besides a textbox. We want reuse the PRADO provided <tt>TLabel</tt> and <tt>TTextBox</tt> to accomplish this task.
@@ -48,13 +48,13 @@ In the above, the method call to <tt>ensureChildControls()</tt> ensures that bot
<h3>Composition by Overriding <tt>createChildControls()</tt></h3>
<p>
-For a composite control as simple as <tt>LabeledTextBox</tt>, it is better to create it by extending <tt>TControl</tt> and overriding the <tt>createChildControls()</tt> method, because it does not use templates and thus saves template parsing time. Note, the new control class must implement the <tt>INamingContainer</tt> interface to ensure the global uniqueness of the ID of its constituent controls.
+For a composite control as simple as <tt>LabeledTextBox</tt>, it is better to create it by extending <tt>TCompositeControl</tt> and overriding the <tt>createChildControls()</tt> method, because it does not use templates and thus saves template parsing time.
</p>
<p>
Complete code for <tt>LabeledTextBox</tt> is shown as follows,
</p>
<com:TTextHighlighter CssClass="source">
-class LabeledTextBox extends TControl implements INamingContainer {
+class LabeledTextBox extends TCompositeControl {
private $_label;
private $_textbox;
protected function createChildControls() {
diff --git a/demos/quickstart/protected/pages/Controls/Samples/LabeledTextBox2/LabeledTextBox.php b/demos/quickstart/protected/pages/Controls/Samples/LabeledTextBox2/LabeledTextBox.php
index 4b8ac2c2..5bbf4ce2 100644
--- a/demos/quickstart/protected/pages/Controls/Samples/LabeledTextBox2/LabeledTextBox.php
+++ b/demos/quickstart/protected/pages/Controls/Samples/LabeledTextBox2/LabeledTextBox.php
@@ -1,6 +1,6 @@
<?php
-class LabeledTextBox extends TControl implements INamingContainer
+class LabeledTextBox extends TCompositeControl
{
private $_label;
private $_textbox;