summaryrefslogtreecommitdiff
path: root/demos/blog-tutorial/protected/pages/Day3/CreateAdminUser.page
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/Day3/CreateAdminUser.page
parentef2fc3942664d4d7131542080e838f7754a3081f (diff)
Update blog tutorial
Diffstat (limited to 'demos/blog-tutorial/protected/pages/Day3/CreateAdminUser.page')
-rw-r--r--demos/blog-tutorial/protected/pages/Day3/CreateAdminUser.page58
1 files changed, 29 insertions, 29 deletions
diff --git a/demos/blog-tutorial/protected/pages/Day3/CreateAdminUser.page b/demos/blog-tutorial/protected/pages/Day3/CreateAdminUser.page
index 36b43014..95d7dac5 100644
--- a/demos/blog-tutorial/protected/pages/Day3/CreateAdminUser.page
+++ b/demos/blog-tutorial/protected/pages/Day3/CreateAdminUser.page
@@ -83,35 +83,35 @@ In the above page template, the datagrid's <tt>OnDeleteCommand</tt> event is tta
<com:TTextHighlighter CssClass="source" Language="php">
class AdminUser extends TPage
{
- /**
- * Populates the datagrid with user lists.
- * This method is invoked by the framework when initializing the page
- * @param mixed event parameter
- */
- public function onInit($param)
- {
- parent::onInit($param);
- // fetches all data account information
- $this->UserGrid->DataSource=UserRecord::finder()->findAll();
- // binds the data to interface components
- $this->UserGrid->dataBind();
- }
-
- /**
- * Deletes a specified user record.
- * This method responds to the datagrid's OnDeleteCommand event.
- * @param TDataGrid the event sender
- * @param TDataGridCommandEventParameter the event parameter
- */
- public function deleteButtonClicked($sender,$param)
- {
- // obtains the datagrid item that contains the clicked delete button
- $item=$param->Item;
- // obtains the primary key corresponding to the datagrid item
- $username=$this->UserGrid->DataKeys[$item->ItemIndex];
- // deletes the user record with the specified username primary key
- UserRecord::finder()->deleteByPk($username);
- }
+ /**
+ * Populates the datagrid with user lists.
+ * This method is invoked by the framework when initializing the page
+ * @param mixed event parameter
+ */
+ public function onInit($param)
+ {
+ parent::onInit($param);
+ // fetches all data account information
+ $this->UserGrid->DataSource=UserRecord::finder()->findAll();
+ // binds the data to interface components
+ $this->UserGrid->dataBind();
+ }
+
+ /**
+ * Deletes a specified user record.
+ * This method responds to the datagrid's OnDeleteCommand event.
+ * @param TDataGrid the event sender
+ * @param TDataGridCommandEventParameter the event parameter
+ */
+ public function deleteButtonClicked($sender,$param)
+ {
+ // obtains the datagrid item that contains the clicked delete button
+ $item=$param->Item;
+ // obtains the primary key corresponding to the datagrid item
+ $username=$this->UserGrid->DataKeys[$item->ItemIndex];
+ // deletes the user record with the specified username primary key
+ UserRecord::finder()->deleteByPk($username);
+ }
}
</com:TTextHighlighter>