From 7fa7f25806e92fe0c4f9c647d413a4fa58680e59 Mon Sep 17 00:00:00 2001 From: xue <> Date: Mon, 24 Sep 2007 16:03:13 +0000 Subject: added TConditional. --- .../protected/pages/Controls/Conditional.page | 39 ++++++++++++++++++++++ .../pages/Controls/Samples/TConditional/Home.page | 14 ++++++++ .../pages/Controls/Samples/TConditional/Home.php | 7 ++++ .../protected/pages/Controls/Standard.page | 6 +++- .../pages/GettingStarted/NewFeatures.page | 1 + 5 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 demos/quickstart/protected/pages/Controls/Conditional.page create mode 100644 demos/quickstart/protected/pages/Controls/Samples/TConditional/Home.page create mode 100644 demos/quickstart/protected/pages/Controls/Samples/TConditional/Home.php (limited to 'demos/quickstart') diff --git a/demos/quickstart/protected/pages/Controls/Conditional.page b/demos/quickstart/protected/pages/Controls/Conditional.page new file mode 100644 index 00000000..e8ea4a65 --- /dev/null +++ b/demos/quickstart/protected/pages/Controls/Conditional.page @@ -0,0 +1,39 @@ + + +

TConditional

+ + +

+TConditional displays appropriate content based on the evaluation result +of a PHP expression specified via Condition. +If the result is true, it instantiates the template TrueTemplate; +otherwise, the template FalseTemplate is instantiated. +The PHP expression is evaluated right before the onInit stage of the control lifecycle. +

+ +

+Since TConditional evaluates Condition at a very early stage, it is recommended +you set Condition in template only and the expression should not refer to +objects that are available on or after the onInit lifecycle. +

+ +

+TConditional is very light. It instantiates either TrueTemplate +FalseTemplate, but never both. And the condition is evaluated only once. +A typical usage of TConditional is shown as following: +

+ + +<com:TConditional Condition="$this->User->IsGuest"> + <prop:TrueTemplate> + Login + </prop:TrueTemplate> + <prop:FalseTemplate> + Logout + </prop:FalseTemplate> +</com:TConditional> + + + + +
$Id$
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/Controls/Samples/TConditional/Home.page b/demos/quickstart/protected/pages/Controls/Samples/TConditional/Home.page new file mode 100644 index 00000000..0c099551 --- /dev/null +++ b/demos/quickstart/protected/pages/Controls/Samples/TConditional/Home.page @@ -0,0 +1,14 @@ + +

TConditional Samples

+ + + + + + + + + + +
$Id$
+
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/Controls/Samples/TConditional/Home.php b/demos/quickstart/protected/pages/Controls/Samples/TConditional/Home.php new file mode 100644 index 00000000..badbca73 --- /dev/null +++ b/demos/quickstart/protected/pages/Controls/Samples/TConditional/Home.php @@ -0,0 +1,7 @@ + \ No newline at end of file diff --git a/demos/quickstart/protected/pages/Controls/Standard.page b/demos/quickstart/protected/pages/Controls/Standard.page index 2b8dd7ab..3b6079d6 100644 --- a/demos/quickstart/protected/pages/Controls/Standard.page +++ b/demos/quickstart/protected/pages/Controls/Standard.page @@ -27,6 +27,10 @@ TColorPicker represents an input field taking color values via a color dialog. +
  • + TConditional displays content corresponding to true or false result of a PHP expression. +
  • +
  • TDatePicker represents an input field taking date values via a calendar dialog.
  • @@ -122,7 +126,7 @@
  • TSlider represents a Slider control
  • - +
  • TStatements accepts a few PHP statements and displays their standard output on the Web page.
  • diff --git a/demos/quickstart/protected/pages/GettingStarted/NewFeatures.page b/demos/quickstart/protected/pages/GettingStarted/NewFeatures.page index 939dd139..adc19fc7 100644 --- a/demos/quickstart/protected/pages/GettingStarted/NewFeatures.page +++ b/demos/quickstart/protected/pages/GettingStarted/NewFeatures.page @@ -12,6 +12,7 @@ This page summarizes the main new features that are introduced in each PRADO rel
  • Added a new control TKeyboard that displays a virtual keyboard for text input.
  • Added a new control TCaptcha that displays a CAPTCHA to keep spammers from signing up for certain accounts online. A related validator TCaptchaValidator is also implemented.
  • Added a new control TSlider that displays a slider which can be used for numeric input.
  • +
  • Added a new control TConditional that conditionally displays one of the two kinds of content.
  • Added Oracle DB support to Active Record.
  • Added support to TDataGrid to allow grouping consecutive cells with the same content.
  • Added support to allow configuring page properties and authorization rules using relative page paths in application and page configurations. Added support to allow authorization based on remote host address.
  • -- cgit v1.2.3