summaryrefslogtreecommitdiff
path: root/demos/blog-tutorial/samples/day5/blog/protected/pages/Contact.php
diff options
context:
space:
mode:
authorxue <>2007-06-29 17:41:20 +0000
committerxue <>2007-06-29 17:41:20 +0000
commit4a9dd5c8513ed96d1e0cf43e370b170dc38fb502 (patch)
treef41bbf25ac5bbc8d0b656c3e7c087e40b09b38b1 /demos/blog-tutorial/samples/day5/blog/protected/pages/Contact.php
parent2d266a7994c57e9a13cccecacf8940e11263614f (diff)
finished blog-tutorial.
Diffstat (limited to 'demos/blog-tutorial/samples/day5/blog/protected/pages/Contact.php')
-rw-r--r--demos/blog-tutorial/samples/day5/blog/protected/pages/Contact.php30
1 files changed, 30 insertions, 0 deletions
diff --git a/demos/blog-tutorial/samples/day5/blog/protected/pages/Contact.php b/demos/blog-tutorial/samples/day5/blog/protected/pages/Contact.php
new file mode 100644
index 00000000..b6ce575e
--- /dev/null
+++ b/demos/blog-tutorial/samples/day5/blog/protected/pages/Contact.php
@@ -0,0 +1,30 @@
+<?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
+ }
+}
+
+?> \ No newline at end of file