summaryrefslogtreecommitdiff
path: root/demos/blog-tutorial/protected/pages/Day1
diff options
context:
space:
mode:
authorwei <>2007-05-10 23:00:04 +0000
committerwei <>2007-05-10 23:00:04 +0000
commite2cb0b52aaa02a3f3f41d0df377d189529713738 (patch)
treeee4c2a3fece40c9a2d4dde75f6e758f7ef05f8f6 /demos/blog-tutorial/protected/pages/Day1
parentef2fc3942664d4d7131542080e838f7754a3081f (diff)
Update blog tutorial
Diffstat (limited to 'demos/blog-tutorial/protected/pages/Day1')
-rw-r--r--demos/blog-tutorial/protected/pages/Day1/CreateContact.page83
-rw-r--r--demos/blog-tutorial/protected/pages/Day1/Setup.page2
-rw-r--r--demos/blog-tutorial/protected/pages/Day1/ShareLayout.page14
3 files changed, 48 insertions, 51 deletions
diff --git a/demos/blog-tutorial/protected/pages/Day1/CreateContact.page b/demos/blog-tutorial/protected/pages/Day1/CreateContact.page
index 4daf43e3..28ad4b21 100644
--- a/demos/blog-tutorial/protected/pages/Day1/CreateContact.page
+++ b/demos/blog-tutorial/protected/pages/Day1/CreateContact.page
@@ -47,37 +47,34 @@ We use template to organize the presentational layout of the feedback form. In t
&lt;com:TForm>
-<h1>Contact</h1>
-<p>Please fill out the following form to let me know your feedback on my blog. Thanks!</p>
-
<span>Your Name:</span>
&lt;com:TRequiredFieldValidator ControlToValidate="Name"
- ErrorMessage="Please provide your name."
- Display="Dynamic" />
+ ErrorMessage="Please provide your name."
+ Display="Dynamic" />
<br/>
&lt;com:TTextBox ID="Name" />
<br/>
<span>Your Email:</span>
&lt;com:TRequiredFieldValidator ControlToValidate="Email"
- ErrorMessage="Please provide your email address."
- Display="Dynamic" />
+ ErrorMessage="Please provide your email address."
+ Display="Dynamic" />
&lt;com:TEmailAddressValidator ControlToValidate="Email"
- ErrorMessage="You entered an invalid email address."
- Display="Dynamic" />
+ ErrorMessage="You entered an invalid email address."
+ Display="Dynamic" />
<br/>
&lt;com:TTextBox ID="Email" />
<br/>
<span>Feedback:</span>
&lt;com:TRequiredFieldValidator ControlToValidate="Feedback"
- ErrorMessage="Please provide your feedback."
- Display="Dynamic" />
+ ErrorMessage="Please provide your feedback."
+ Display="Dynamic" />
<br/>
&lt;com:TTextBox ID="Feedback"
- TextMode="MultiLine"
- Rows="10"
- Columns="40" />
+ TextMode="MultiLine"
+ Rows="10"
+ Columns="40" />
<br/>
&lt;com:TButton Text="Submit" OnClick="submitButtonClicked" />
@@ -103,13 +100,13 @@ Besides <tt>TTextBox</tt> controls, the template also uses many validator contro
<com:TTextHighlighter CssClass="source" Language="prado">
<span>Your Email:</span>
&lt;com:TRequiredFieldValidator
- ControlToValidate="Email"
- ErrorMessage="Please provide your email address."
- Display="Dynamic" />
+ ControlToValidate="Email"
+ ErrorMessage="Please provide your email address."
+ Display="Dynamic" />
&lt;com:TEmailAddressValidator
- ControlToValidate="Email"
- ErrorMessage="You entered an invalid email address."
- Display="Dynamic" />
+ ControlToValidate="Email"
+ ErrorMessage="You entered an invalid email address."
+ Display="Dynamic" />
<br/>
&lt;com:TTextBox ID="Email" />
<br/>
@@ -152,29 +149,29 @@ We thus write down the page class as follows:
<?php
class Contact extends TPage
{
- /**
- * Event handler for the OnClick event of the submit button.
- * @param TButton the button triggering the event
- * @param TEventParameter event parameter (null here)
- */
- public function submitButtonClicked($sender, $param)
- {
- if ($this->IsValid) // check if input validation is successful
- {
- // obtain the user name, email, feedback from the textboxes
- $name = $this->Name->Text;
- $email = $this->Email->Text;
- $feedback = $this->Feedback->Text;
-
- // send an email to administrator with the above information
- $this->mailFeedback($name, $email, $feedback);
- }
- }
-
- protected function mailFeedback($name, $email, $feedback)
- {
- // implementation of sending the feedback email
- }
+ /**
+ * Event handler for the OnClick event of the submit button.
+ * @param TButton the button triggering the event
+ * @param TEventParameter event parameter (null here)
+ */
+ public function submitButtonClicked($sender, $param)
+ {
+ if ($this->IsValid) // check if input validation is successful
+ {
+ // obtain the user name, email, feedback from the textboxes
+ $name = $this->Name->Text;
+ $email = $this->Email->Text;
+ $feedback = $this->Feedback->Text;
+
+ // send an email to administrator with the above information
+ $this->mailFeedback($name, $email, $feedback);
+ }
+ }
+
+ protected function mailFeedback($name, $email, $feedback)
+ {
+ // implementation of sending the feedback email
+ }
}
?>
</com:TTextHighlighter>
diff --git a/demos/blog-tutorial/protected/pages/Day1/Setup.page b/demos/blog-tutorial/protected/pages/Day1/Setup.page
index 0fe877bf..e8316253 100644
--- a/demos/blog-tutorial/protected/pages/Day1/Setup.page
+++ b/demos/blog-tutorial/protected/pages/Day1/Setup.page
@@ -13,7 +13,7 @@ Assume <tt>blog</tt> is the name of the directory to hold the whole blog system,
<p>
Under the <tt>blog</tt> directory, we run the <a href="http://www.pradosoft.com/demos/quickstart/?page=GettingStarted.CommandLine">PRADO command line tool</a> with the following command (replace <tt>path/to</tt> with the actual path to the PRADO framework installation):
</p>
-<com:TTextHighlighter CssClass="source">
+<com:TTextHighlighter CssClass="source cli">
php path/to/prado-cli.php -c .
</com:TTextHighlighter>
diff --git a/demos/blog-tutorial/protected/pages/Day1/ShareLayout.page b/demos/blog-tutorial/protected/pages/Day1/ShareLayout.page
index d3d1f553..d6c4d29f 100644
--- a/demos/blog-tutorial/protected/pages/Day1/ShareLayout.page
+++ b/demos/blog-tutorial/protected/pages/Day1/ShareLayout.page
@@ -135,13 +135,13 @@ We can specify master in code like the following to enable dynamic change of lay
<?php
class Contact extends TPage
{
- public function onPreInit($param)
- {
- parent::onPreInit($param);
- $this->MasterClass='Path.To.NewLayout';
- }
-
- // ...
+ public function onPreInit($param)
+ {
+ parent::onPreInit($param);
+ $this->MasterClass='Path.To.NewLayout';
+ }
+
+ // ...
}
?>
</com:TTextHighlighter>