summaryrefslogtreecommitdiff
path: root/demos
diff options
context:
space:
mode:
Diffstat (limited to 'demos')
-rw-r--r--demos/quickstart/protected/pages/Advanced/Assets.page2
-rw-r--r--demos/quickstart/protected/pages/Advanced/MasterContent.page4
2 files changed, 6 insertions, 0 deletions
diff --git a/demos/quickstart/protected/pages/Advanced/Assets.page b/demos/quickstart/protected/pages/Advanced/Assets.page
index 857da3a1..6460cb0a 100644
--- a/demos/quickstart/protected/pages/Advanced/Assets.page
+++ b/demos/quickstart/protected/pages/Advanced/Assets.page
@@ -35,6 +35,7 @@ ADVISORY: Do not overuse asset publishing. The asset concept is mainly used to h
<h2>A Toggle Button Example</h2>
<p>
We now use the toggle button example to explain the usage of assets. The control uses two image files <tt>up.gif</tt> and <tt>down.gif</tt>, which are stored under the directory containing the control class file. When the button is in <tt>Up</tt> state, we would like to show the <tt>up.gif</tt> image. This can be done as follows,
+</p>
<com:TTextHighlighter CssClass="source">
class ToggleButton extends TWebControl {
...
@@ -49,6 +50,7 @@ class ToggleButton extends TWebControl {
...
}
</com:TTextHighlighter>
+<p>
In the above, the call <tt>$this->getAsset('up.gif')</tt> will publish the <tt>up.gif</tt> image file and return a URL for the published image file. The URL is then rendered as the <tt>src</tt> attribute of the HTML image tag.
</p>
<p>
diff --git a/demos/quickstart/protected/pages/Advanced/MasterContent.page b/demos/quickstart/protected/pages/Advanced/MasterContent.page
index 6ac1b757..434bc413 100644
--- a/demos/quickstart/protected/pages/Advanced/MasterContent.page
+++ b/demos/quickstart/protected/pages/Advanced/MasterContent.page
@@ -8,6 +8,7 @@ Pages in a Web application often share common portions. For example, all pages o
Master and content only apply to template controls (controls extending <tt>TTemplateControl</tt> or its child classes). A template control can have at most one master control and one or several contents (each represented by a <tt>TContent</tt> control). Contents will be inserted into the master control at places reserved by <tt>TContentPlaceHolder</tt> controls. And the presentation of the template control is that of the master control with <tt>TContentPlaceHolder</tt> replaced by <tt>TContent</tt>.
<p>
For example, assume a template control has the following template:
+</p>
<com:TTextHighlighter Language="prado" CssClass="source">
&lt;%@ MasterClass="MasterControl" %&gt;
&lt;com:TContent ID="A" &gt;
@@ -20,7 +21,9 @@ content B
content B
&lt;/com:TContent &gt;
</com:TTextHighlighter>
+<p>
which uses <tt>MasterControl</tt> as its master control. The master control has the following template,
+</p>
<com:TTextHighlighter Language="prado" CssClass="source">
other stuff
&lt;com:TContentPlaceHolder ID="A" /&gt;
@@ -30,6 +33,7 @@ other stuff
&lt;com:TContentPlaceHolder ID="C" /&gt;
other stuff
</com:TTextHighlighter>
+<p>
Then, the contents are inserted into the master control according to the following diagram, while the resulting parent-child relationship can be shown in the next diagram. Note, the template control discards everything in the template other than the contents, while the master control keeps everything and replaces the content placeholders with the contents according to ID matching.
</p>
<img src=<%~ mastercontent.gif %> alt="Master and Content" />