diff options
author | xue <> | 2006-04-15 14:35:46 +0000 |
---|---|---|
committer | xue <> | 2006-04-15 14:35:46 +0000 |
commit | 70944795827cffd1bd5a27a9c4a99eb1434f905f (patch) | |
tree | 8c77df484074d8a104a4646a4e2fa6c051324ed4 /demos/quickstart | |
parent | 3ba2c4fbc3a5e07d3f51dc2a89e9eed24b9f2a16 (diff) |
Merge from branch 3.0 till 913.
Diffstat (limited to 'demos/quickstart')
7 files changed, 31 insertions, 23 deletions
diff --git a/demos/quickstart/protected/pages/Configurations/Templates2.page b/demos/quickstart/protected/pages/Configurations/Templates2.page index 0971c828..9fc06fb4 100644 --- a/demos/quickstart/protected/pages/Configurations/Templates2.page +++ b/demos/quickstart/protected/pages/Configurations/Templates2.page @@ -10,7 +10,7 @@ Dynamic content tags are introduced as shortcuts to some commonly used <a href=" <a name="et"></a>
<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. The context (namely <tt>$this</tt>) of the expression is the control owning the template.
+An expression tag represents a PHP expression that is evaluated when the template control is in <tt>PreRender</tt> stage. The expression evaluation result is inserted at the place where the tag resides in the template. The context (namely <tt>$this</tt>) of the expression is the control owning the template.
</p>
<p>
The format of an expression tag is as follows,
diff --git a/demos/quickstart/protected/pages/Configurations/Templates3.page b/demos/quickstart/protected/pages/Configurations/Templates3.page index d08f8736..b97b1583 100644 --- a/demos/quickstart/protected/pages/Configurations/Templates3.page +++ b/demos/quickstart/protected/pages/Configurations/Templates3.page @@ -5,11 +5,13 @@ <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,
+</p>
<com:TTextHighlighter Language="prado" CssClass="source">
<com:ComponentType PropertyName=DynamicPropertyTag ...>
body content
</com:ComponentType>
</com:TTextHighlighter>
+<p>
where you may enclose <tt>DynamicPropertyTag</tt> within single or double quotes for better readability.
</p>
<p>
@@ -19,51 +21,54 @@ Like dynamic content tags, we have <a href="#et">expression tags</a>, <a href="# <a name="et"></a>
<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,
+An expression tag represents a PHP expression that is evaluated when the control is in <tt>PreRender</tt> stage. The expression evaluation result is assigned to the corresponding component property. The format of expression tags is as follows,
+</p>
<com:TTextHighlighter Language="prado" CssClass="source">
<%= PhpExpression %>
</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,
+<p>
+In the expression, <tt>$this</tt> refers to the control owning the template. 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,
+</p>
<com:TTextHighlighter Language="prado" CssClass="source">
<com:TLabel Text=<%= $this->Page->Title %> />
</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.
-</p>
<a name="dt"></a>
<h3>Databind Tags</h3>
<p>
-Databind tags are similar to expression tags, except that they can only be used with control properties and the expressions are evaluated only when a <tt>dataBind()</tt> call is invoked on the controls represented by the component tags. In the expression, <tt>$this</tt> refers to the control itself. Databind tags do not apply to all components. They can only be used for controls.
+Databind tags are similar to expression tags, except that they can only be used with control properties and the expressions are evaluated only when a <tt>dataBind()</tt> call is invoked on the controls represented by the component tags. In the expression, <tt>$this</tt> refers to the control owning the template. Databind tags do not apply to all components. They can only be used for controls.
</p>
<p>
The format of databind tags is as follows,
+</p>
<com:TTextHighlighter Language="prado" CssClass="source">
<%# PhpExpression %>
</com:TTextHighlighter>
-</p>
<a name="pt"></a>
<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,
+</p>
<com:TTextHighlighter Language="prado" CssClass="source">
<%$ ParameterName %>
</com:TTextHighlighter>
+<p>
Note, application parameters are usually defined in application configurations or page directory configurations. The parameters are evaluated when the template is instantiated.
</p>
<a name="at"></a>
<h3>Asset Tags</h3>
<p>
-Asset tags are used to publish private files and assign the corresponding the URLs to the component properties. For example, if you have an image file that is not Web-accessible and you want to make it visible to end-users, you can use asset tags to publish this file and show the URL to end-users so that they can fetch the published image.
+Asset tags are used to publish private files and assign the corresponding the URLs to the component properties. For example, if you have an image file that is not Web-accessible and you want to make it visible to end-users, you can use asset tags to publish this file and show the URL to end-users so that they can fetch the published image. The asset tags are evaluated when the template is instantiated.
</p>
<p>
The format of asset tags is as follows,
+</p>
<com:TTextHighlighter Language="prado" CssClass="source">
<%~ LocalFileName %>
</com:TTextHighlighter>
+<p>
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>
@@ -74,9 +79,12 @@ BE VERY CAUTIOUS when you are using asset tags as it may expose to end-users fil <h3>Localization Tags</h3>
<p>
Localization tags represent localized texts. They are in the following format,
+</p>
<com:TTextHighlighter Language="prado" CssClass="source">
<%[string]%>
</com:TTextHighlighter>
-where <tt>string</tt> will be translated to different languages according to the end-user's language preference.
+<p>
+where <tt>string</tt> will be translated to different languages according to the end-user's language preference. The localization tags are evaluated when the template is instantiated.
+</p>
</com:TContent>
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/Controls/Samples/TDataGrid/Sample3.page b/demos/quickstart/protected/pages/Controls/Samples/TDataGrid/Sample3.page index be2f80bc..2864de46 100644 --- a/demos/quickstart/protected/pages/Controls/Samples/TDataGrid/Sample3.page +++ b/demos/quickstart/protected/pages/Controls/Samples/TDataGrid/Sample3.page @@ -48,11 +48,11 @@ />
<com:TTemplateColumn HeaderText="Rating">
<prop:ItemTemplate>
- <img src="images/star<%#$this->NamingContainer->DataItem['rating']%>.gif" alt="" />
+ <img src="images/star<%#$this->Parent->DataItem['rating']%>.gif" alt="" />
</prop:ItemTemplate>
<prop:EditItemTemplate>
<com:TDropDownList
- SelectedValue=<%#$this->NamingContainer->DataItem['rating'] %>
+ SelectedValue=<%#$this->Parent->DataItem['rating'] %>
ID="Rating">
<com:TListItem Value="1" />
<com:TListItem Value="2" />
diff --git a/demos/quickstart/protected/pages/Controls/Samples/TDataList/Sample2.page b/demos/quickstart/protected/pages/Controls/Samples/TDataList/Sample2.page index 4b484b21..a0908f60 100644 --- a/demos/quickstart/protected/pages/Controls/Samples/TDataList/Sample2.page +++ b/demos/quickstart/protected/pages/Controls/Samples/TDataList/Sample2.page @@ -26,7 +26,7 @@ <tr>
<td>
<com:TLinkButton
- Text=<%#$this->Parent->DataItem['id']%>
+ Text=<%#$this->DataItem['id']%>
CommandName="select"
/>
<%#$this->DataItem['name']%>
@@ -83,7 +83,7 @@ <td align="right">Name</td>
<td><com:TTextBox
ID="ProductName"
- Text=<%#$this->Parent->DataItem['name'] %>
+ Text=<%#$this->DataItem['name'] %>
/>
</td>
</tr>
@@ -91,7 +91,7 @@ <td align="right">Quantity</td>
<td><com:TTextBox
ID="ProductQuantity"
- Text=<%#$this->Parent->DataItem['quantity'] %>
+ Text=<%#$this->DataItem['quantity'] %>
/>
</td>
</tr>
@@ -99,7 +99,7 @@ <td align="right">Price</td>
<td><com:TTextBox
ID="ProductPrice"
- Text=<%#$this->Parent->DataItem['price'] %>
+ Text=<%#$this->DataItem['price'] %>
/>
</td>
</tr>
@@ -107,7 +107,7 @@ <td align="right">Imported</td>
<td><com:TCheckBox
ID="ProductImported"
- Checked=<%#$this->Parent->DataItem['imported'] %>
+ Checked=<%#$this->DataItem['imported'] %>
/>
</td>
</tr>
diff --git a/demos/quickstart/protected/pages/Controls/Samples/TRepeater/Sample3.page b/demos/quickstart/protected/pages/Controls/Samples/TRepeater/Sample3.page index 38636962..4b6849e9 100644 --- a/demos/quickstart/protected/pages/Controls/Samples/TRepeater/Sample3.page +++ b/demos/quickstart/protected/pages/Controls/Samples/TRepeater/Sample3.page @@ -19,7 +19,7 @@ The following example allows users to modify the existing tabular data using a < <td>
<com:TTextBox
ID="ProductName"
- Text=<%#$this->Parent->DataItem['name']%> />
+ Text=<%#$this->DataItem['name']%> />
</td>
<td>
<com:TDropDownList
@@ -29,12 +29,12 @@ The following example allows users to modify the existing tabular data using a < <com:TTextBox
ID="ProductPrice"
Columns="7"
- Text=<%#$this->Parent->DataItem['price']%> />
+ Text=<%#$this->DataItem['price']%> />
</td>
<td>
<com:TCheckBox
ID="ProductImported"
- Checked=<%#$this->Parent->DataItem['imported']%> />
+ Checked=<%#$this->DataItem['imported']%> />
<com:TRequiredFieldValidator
ControlToValidate="ProductName"
ErrorMessage="Product name cannot be empty."
diff --git a/demos/quickstart/protected/pages/Controls/Samples/TTextBox/Home.page b/demos/quickstart/protected/pages/Controls/Samples/TTextBox/Home.page index 49d254a8..b6357722 100644 --- a/demos/quickstart/protected/pages/Controls/Samples/TTextBox/Home.page +++ b/demos/quickstart/protected/pages/Controls/Samples/TTextBox/Home.page @@ -89,7 +89,7 @@ Safety feature (cross-site scripting prevention): <b>SafeText:</b>
<com:TLabel ID="Output"
BackColor="silver"
- Text=<%#$this->Page->TextBox2->SafeText%> />
+ Text=<%#$this->TextBox2->SafeText%> />
</td></tr>
</table>
diff --git a/demos/quickstart/protected/pages/Fundamentals/Modules.page b/demos/quickstart/protected/pages/Fundamentals/Modules.page index ebf4ac53..782ebb8c 100644 --- a/demos/quickstart/protected/pages/Fundamentals/Modules.page +++ b/demos/quickstart/protected/pages/Fundamentals/Modules.page @@ -41,7 +41,7 @@ Error handler module is used to capture and process all error conditions in an a PRADO is released with a few more modules besides the core ones. They include caching modules (<tt>TSqliteCache</tt> and <tt>TMemCache</tt>), user management module (<tt>TUserManager</tt>), authentication and authorization module (<tt>TAuthManager</tt>), etc.
</p>
<p>
-When <tt>TPageService</tt> is requested, it also loads modules specific for page service, including asset manager (<tt>TAssetManager</tt>), template manager (<tt>TTemplateManager</tt>), theme/skin manager (<tt>TThemeManager</tt>), and page state persister (<tt>TPageStatePersister</tt>).
+When <tt>TPageService</tt> is requested, it also loads modules specific for page service, including asset manager (<tt>TAssetManager</tt>), template manager (<tt>TTemplateManager</tt>), theme/skin manager (<tt>TThemeManager</tt>).
</p>
<p>
Custom modules and core modules are all configurable via <a href="?page=Configurations.Overview">configurations</a>.
|