diff options
Diffstat (limited to 'demos/quickstart/protected/pages')
4 files changed, 42 insertions, 42 deletions
diff --git a/demos/quickstart/protected/pages/Configurations/Templates1.page b/demos/quickstart/protected/pages/Configurations/Templates1.page index d9b71d35..ec230599 100644 --- a/demos/quickstart/protected/pages/Configurations/Templates1.page +++ b/demos/quickstart/protected/pages/Configurations/Templates1.page @@ -13,35 +13,35 @@ A component tag specifies a component as part of the body content of the templat </p>
<p>
The format of a component tag is as follows,
-<pre class="source">
+<com:TTextHighlighter Language="prado" CssClass="source">
<com:ComponentType PropertyName="PropertyValue" ... EventName="EventHandler" ...>
body content
</com:ComponentType>
-</pre>
+</com:TTextHighlighter>
<tt>ComponentType</tt> can be either the class name or the dotted type name (e.g. <tt>System.Web.UI.TControl</tt>) of the component. <tt>PropertyName</tt> and <tt>EventName</tt> are both case-insensitive. <tt>PropertyName</tt> can be a property or subproperty name (e.g. <tt>Font.Name</tt>). Note, <tt>PropertyValue</tt> will be HTML-decoded when assigned to the corresponding property. Content enclosed between the opening and closing component tag are normally treated the body of the component.
</p>
<p>
It is required that component tags nest properly with each other and an opening component tag be paired with a closing tag, similar to that in XML. The following shows a component tag specifying the <tt>Text</tt> property and <tt>Click</tt> event of a button control,
-<pre class="source">
+<com:TTextHighlighter Language="prado" CssClass="source">
<com:TButton Text="Register" Click="registerUser" />
-</pre>
+</com:TTextHighlighter>
</p>
<p>
To deal conveniently with properties taking take big trunk of initial data, the following property initialization tag is introduced,
-<pre class="source">
+<com:TTextHighlighter Language="prado" CssClass="source">
<prop:PropertyName>
PropertyValue
</prop:PropertyName>
-</pre>
+</com:TTextHighlighter>
It is equivalent to <tt>...PropertyName="PropertyValue"...</tt> in a component tag. Property initialization tags must be directly enclosed between the corresponding opening and closing component tag.
</p>
<a name="tct" />
<h2>Template Control Tags</h2>
A template control tag is used to configure the initial property values of the control owning the template. Its format is as follows,
-<pre class="source">
+<com:TTextHighlighter Language="prado" CssClass="source">
<%@ PropertyName="PropertyValue" ... %>
-</pre>
+</com:TTextHighlighter>
Like in component tags, <tt>PropertyName</tt> is case-insensitive and can be a property or subproperty name.
</p>
<p>
@@ -55,7 +55,7 @@ Template control tag is optional in a template. Each template can contain at mos <h2>Comment Tags</h2>
<p>
Comment tags are used to put comments in the template or the ultimate rendering result. There are two types of comment tags. One is like that in HTML and will be displayed to the end-users. The other only appear in a template and will be stripped out when the template is instantiated and displayed to the end-users. The format of these two comment tags is as follows,
-<pre class="source">
+<com:TTextHighlighter Language="prado" CssClass="source">
<!--
Comments VISIBLE to end-users
-->
@@ -63,7 +63,7 @@ Comments VISIBLE to end-users <!
Comments INVISIBLE to end-users
!>
-</pre>
+</com:TTextHighlighter>
</p>
</com:TContent>
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/Configurations/Templates2.page b/demos/quickstart/protected/pages/Configurations/Templates2.page index c4528a0b..66d9d0d1 100644 --- a/demos/quickstart/protected/pages/Configurations/Templates2.page +++ b/demos/quickstart/protected/pages/Configurations/Templates2.page @@ -11,51 +11,51 @@ Dynamic content tags are introduced as shortcuts to some commonly used <a href=" <h3>Expression Tags</h3>
<p>
An expression tag represents a PHP expression that is evaluated when the template control is being rendered. The expression evaluation result is inserted at the place where the tag resides in the template. Its format is as follows,
-<pre class="source">
+<com:TTextHighlighter Language="prado" CssClass="source">
<%= PhpExpression %>
-</pre>
+</com:TTextHighlighter>
Inernally, an expression tag is represented by a <tt>TExpression</tt> control. Therefore, in the expression <tt>$this</tt> refers to the <tt>TExpression</tt> control. For example, the following expression tag will display the current page title at the place,
-<pre class="source">
+<com:TTextHighlighter Language="prado" CssClass="source">
<%= $this->Page->Title %>
-</pre>
+</com:TTextHighlighter>
</p>
<a name="st" />
<h3>Statement Tags</h3>
<p>
Statement tags are similar to expression tags, except that statement tags contain PHP statements rather than expressions. The output of the PHP statements (using for example <tt>echo</tt> or <tt>print</tt> in PHP) are displayed at the place where the statement tag resides in the template. Inernally, a statement tag is represented by a <tt>TStatements</tt> control. Therefore, in the statements <tt>$this</tt> refers to the <tt>TStatements</tt> control. The format of statement tags is as follows,
-<pre class="source">
+<com:TTextHighlighter Language="prado" CssClass="source">
<%%
PHP Statements
%>
-</pre>
+</com:TTextHighlighter>
</p>
<p>
The following example displays the current time in Dutch at the place,
-<pre class="source">
+<com:TTextHighlighter Language="prado" CssClass="source">
<%%
setlocale(LC_ALL, 'nl_NL');
echo strftime("%A %e %B %Y",time());
%>
-</pre>
+</com:TTextHighlighter>
</p>
<a name="dt" />
<h3>Databind Tags</h3>
<p>
Databind tags are similar to expression tags, except that the expressions are evaluated only when a <tt>dataBind()</tt> call is invoked on the controls representing the databind tags. Internally, a <tt>TLiteral</tt> control is used to represent a databind tag and <tt>$this</tt> in the expression would refer to the control. The format of databind tags is as follows,
-<pre class="source">
+<com:TTextHighlighter Language="prado" CssClass="source">
<%# PhpExpression %>
-</pre>
+</com:TTextHighlighter>
</p>
<a name="pt" />
<h3>Parameter Tags</h3>
<p>
Parameter tags are used to insert application parameters at the place where they appear in the template. The format of parameter tags is as follows,
-<pre class="source">
+<com:TTextHighlighter Language="prado" CssClass="source">
<%$ ParameterName %>
-</pre>
+</com:TTextHighlighter>
Note, application parameters are usually defined in application configurations or page directory configurations. The parameters are evaluated when the template is instantiated.
</p>
@@ -66,9 +66,9 @@ Asset tags are used to publish private files and display the corresponding the U </p>
<p>
The format of asset tags is as follows,
-<pre class="source">
+<com:TTextHighlighter Language="prado" CssClass="source">
<%~ LocalFileName %>
-</pre>
+</com:TTextHighlighter>
where <tt>LocalFileName</tt> refers to a file path that is relative to the directory containing the current template file. The file path can be a single file or a directory. If the latter, the content in the whole directory will be made accessible by end-users.
</p>
<p>
diff --git a/demos/quickstart/protected/pages/Configurations/Templates3.page b/demos/quickstart/protected/pages/Configurations/Templates3.page index 7ab55281..ae496553 100644 --- a/demos/quickstart/protected/pages/Configurations/Templates3.page +++ b/demos/quickstart/protected/pages/Configurations/Templates3.page @@ -5,11 +5,11 @@ <h2>Dynamic Property Tags</h2>
<p>
Dynamic property tags are very similar to dynamic content tags, except that they are applied to component properties. The purpose of dynamic property tags is to allow more versatile component property configuration. Note, you are not required to use dynamic property tags because what can be done using dynamic property tags can also be done in PHP code. However, using dynamic property tags bring you much more convenience at accomplishing the same tasks. The basic usage of dynamic property tags is as follows,
-<pre class="source">
+<com:TTextHighlighter Language="prado" CssClass="source">
<com:ComponentType PropertyName=DynamicPropertyTag ...>
body content
</com:ComponentType>
-</pre>
+</com:TTextHighlighter>
where you may enclose <tt>DynamicPropertyTag</tt> within single or double quotes for better readability.
</p>
<p>
@@ -20,13 +20,13 @@ We now introduce the available types of dynamic property tags that may be used i <h3>Expression Tags</h3>
<p>
An expression tag represents a PHP expression that is evaluated when the template is being instantiated. The expression evaluation result is assigned to the corresponding component property. The format of expression tags is as follows,
-<pre class="source">
+<com:TTextHighlighter Language="prado" CssClass="source">
<%= PhpExpression %>
-</pre>
+</com:TTextHighlighter>
In the expression, <tt>$this</tt> refers to the component specified by the component tag. The following example specifies a <tt>TLabel</tt> control whose <tt>Text</tt> property is initialized as the current page title when the <tt>TLabel</tt> control is being constructed,
-<pre class="source">
+<com:TTextHighlighter Language="prado" CssClass="source">
<com:TLabel Text=<%= $this->Page->Title %> />
-</pre>
+</com:TTextHighlighter>
</p>
<p>
Note, unlike dynamic content tags, the expressions tags for component properties are evaluated when the components are being constructed, while for the dynamic content tags, the expressions are evaluated when the controls are being rendered.
@@ -39,18 +39,18 @@ Databind tags are similar to expression tags, except that the expressions are ev </p>
<p>
The format of databind tags is as follows,
-<pre class="source">
+<com:TTextHighlighter Language="prado" CssClass="source">
<%# PhpExpression %>
-</pre>
+</com:TTextHighlighter>
</p>
<a name="pt" />
<h3>Parameter Tags</h3>
<p>
Parameter tags are used to assign application parameter values to the corresponding component properties. The format of parameter tags is as follows,
-<pre class="source">
+<com:TTextHighlighter Language="prado" CssClass="source">
<%$ ParameterName %>
-</pre>
+</com:TTextHighlighter>
Note, application parameters are usually defined in application configurations or page directory configurations. The parameters are evaluated when the template is instantiated.
</p>
@@ -61,9 +61,9 @@ Asset tags are used to publish private files and assign the corresponding the UR </p>
<p>
The format of asset tags is as follows,
-<pre class="source">
+<com:TTextHighlighter Language="prado" CssClass="source">
<%~ LocalFileName %>
-</pre>
+</com:TTextHighlighter>
where <tt>LocalFileName</tt> refers to a file path that is relative to the directory containing the current template file. The file path can be a single file or a directory. If the latter, the content in the whole directory will be made accessible by end-users.
</p>
<p>
diff --git a/demos/quickstart/protected/pages/Fundamentals/Components.page b/demos/quickstart/protected/pages/Fundamentals/Components.page index 20888fba..be71b18b 100644 --- a/demos/quickstart/protected/pages/Fundamentals/Components.page +++ b/demos/quickstart/protected/pages/Fundamentals/Components.page @@ -7,7 +7,7 @@ A component is an instance of <tt>TComponent</tt> or its child class. The base c <h2>Component Properties</h2>
<p>
A component property can be viewed as a public variable describing a specific aspect of the component, such as the background color, the font size, etc. A property is defined by the existence of a getter and/or a setter method in the component class. For example, in <tt>TControl</tt>, we define its <tt>ID</tt> property using the following getter and setter methods,
-<pre class="source">
+<com:TTextHighlighter Language="php" CssClass="source">
class TControl extends TComponent {
public function getID() {
...
@@ -16,7 +16,7 @@ class TControl extends TComponent { ...
}
}
-</pre>
+</com:TTextHighlighter>
</p>
<p>
To get or set the <tt>ID</tt> property, do as follows, just like working with a variable,
@@ -58,20 +58,20 @@ Component events are special properties that take method names as their values. </p>
<p>
A component event is defined by the existence of an <tt>on</tt>-method. For example, in <tt>TButton</tt>, we have
-<pre class="source">
+<com:TTextHighlighter Language="php" CssClass="source">
class TButton extends TWebControl {
public function onClick($param) {
...
}
}
-</pre>
+</com:TTextHighlighter>
This defines an event named <tt>Click</tt>, and a handler can be attached to the event using one of the following ways,
-<pre class="source">
+<com:TTextHighlighter Language="php" CssClass="source">
$button->Click=$callback;
$button->Click->add($callback);
$button->Click[]=$callback;
$button->attachEventHandler('Click',$callback);
-</pre>
+</com:TTextHighlighter>
where <tt>$callback</tt> refers to a valid PHP callback (e.g. a function name, a class method <tt>array($object,'method')</tt>, etc.)
</p>
|