From 962fb7adc2bc5f4cd9295bb769c5b58e3f6f7c30 Mon Sep 17 00:00:00 2001 From: xue <> Date: Fri, 27 Jan 2006 05:32:26 +0000 Subject: make the assets, master and content pages xhtml-compatible. --- demos/quickstart/protected/pages/Advanced/Assets.page | 2 ++ demos/quickstart/protected/pages/Advanced/MasterContent.page | 4 ++++ 2 files changed, 6 insertions(+) (limited to 'demos/quickstart/protected') 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

A Toggle Button Example

We now use the toggle button example to explain the usage of assets. The control uses two image files up.gif and down.gif, which are stored under the directory containing the control class file. When the button is in Up state, we would like to show the up.gif image. This can be done as follows, +

class ToggleButton extends TWebControl { ... @@ -49,6 +50,7 @@ class ToggleButton extends TWebControl { ... } +

In the above, the call $this->getAsset('up.gif') will publish the up.gif image file and return a URL for the published image file. The URL is then rendered as the src attribute of the HTML image tag.

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 TTemplateControl or its child classes). A template control can have at most one master control and one or several contents (each represented by a TContent control). Contents will be inserted into the master control at places reserved by TContentPlaceHolder controls. And the presentation of the template control is that of the master control with TContentPlaceHolder replaced by TContent.

For example, assume a template control has the following template: +

<%@ MasterClass="MasterControl" %> <com:TContent ID="A" > @@ -20,7 +21,9 @@ content B content B </com:TContent > +

which uses MasterControl as its master control. The master control has the following template, +

other stuff <com:TContentPlaceHolder ID="A" /> @@ -30,6 +33,7 @@ other stuff <com:TContentPlaceHolder ID="C" /> other stuff +

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.

alt="Master and Content" /> -- cgit v1.2.3