From 6215202c20ab394f273c4b79b71f80003bf757f4 Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Tue, 14 Jan 2014 22:36:10 +0100 Subject: Removed TJavascriptLogger from demos and tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Any browser’s development tool is way better, and it stops exceptions from being catched by the browser’s console (cherry picked from commit 0a136fe37491281ada5084b6eb5a72d4ca8d948a) --- demos/quickstart/protected/pages/Tutorial/AjaxChat.page | 7 +++---- demos/quickstart/protected/pages/Tutorial/fr/AjaxChat.page | 5 ++--- 2 files changed, 5 insertions(+), 7 deletions(-) (limited to 'demos/quickstart/protected/pages/Tutorial') diff --git a/demos/quickstart/protected/pages/Tutorial/AjaxChat.page b/demos/quickstart/protected/pages/Tutorial/AjaxChat.page index d94dfa89..4a8f23ab 100755 --- a/demos/quickstart/protected/pages/Tutorial/AjaxChat.page +++ b/demos/quickstart/protected/pages/Tutorial/AjaxChat.page @@ -170,7 +170,7 @@ as App_Code/chat.db. class ChatUserRecord extends TActiveRecord { const TABLE='chat_users'; - + public $username; public $last_activity; @@ -431,7 +431,6 @@ and a button to send the message. Text="Send" /> </com:TForm> -<com:TJavascriptLogger /> @@ -572,7 +571,7 @@ public function getUserMessages($user) $content = ''; foreach($this->findAll('for_user = ?', $user) as $message) $content .= $this->formatMessage($message); - $this->deleteAll('for_user = ? OR created_on < ?', + $this->deleteAll('for_user = ? OR created_on < ?', $user, time() - 300); //5 min inactivity return $content; } @@ -581,7 +580,7 @@ protected function formatMessage($message) { $user = htmlspecialchars($message->from_user); $content = htmlspecialchars($message->message); - return "
{$user}:" + return "
{$user}:" ." {$content}
"; } diff --git a/demos/quickstart/protected/pages/Tutorial/fr/AjaxChat.page b/demos/quickstart/protected/pages/Tutorial/fr/AjaxChat.page index 66bb0e43..39d7f9e5 100755 --- a/demos/quickstart/protected/pages/Tutorial/fr/AjaxChat.page +++ b/demos/quickstart/protected/pages/Tutorial/fr/AjaxChat.page @@ -430,7 +430,6 @@ and a button to send the message. Text="Send" />
</com:TForm> -<com:TJavascriptLogger /> @@ -571,7 +570,7 @@ public function getUserMessages($user) $content = ''; foreach($this->findAll('for_user = ?', $user) as $message) $content .= $this->formatMessage($message); - $this->deleteAll('for_user = ? OR created_on < ?', + $this->deleteAll('for_user = ? OR created_on < ?', $user, time() - 300); //5 min inactivity return $content; } @@ -580,7 +579,7 @@ protected function formatMessage($message) { $user = htmlspecialchars($message->from_user); $content = htmlspecialchars($message->message); - return "
{$user}:" + return "
{$user}:" ." {$content}
"; } -- cgit v1.2.3 From 21a909f819cc340564770ea63e383ee6013fc167 Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Wed, 15 Jan 2014 19:03:29 +0100 Subject: Removed ?> from buildscripts and demos --- buildscripts/classtree/DWExtension.php | 1 - buildscripts/index/build.php | 2 - buildscripts/index/quickstart_index.php | 1 - buildscripts/index/search.php | 4 +- buildscripts/phing/tasks/PradoPearTask.php | 2 - buildscripts/phpbuilder/build.php | 2 - buildscripts/texbuilder/Page2Tex.php | 2 - buildscripts/texbuilder/quickstart/build.php | 3 - buildscripts/texbuilder/quickstart/pages.php | 2 - buildscripts/texbuilder/sqlmap/build.php | 3 - buildscripts/texbuilder/sqlmap/pages.php | 2 - buildscripts/texbuilder/time-tracker/pages.php | 2 - .../protected/pages/Day1/CreateContact.page | 31 +++++---- .../blog-tutorial/protected/pages/Day1/Setup.page | 5 +- .../protected/pages/Day1/ShareLayout.page | 2 - .../protected/pages/Day1/fr/CreateContact.page | 33 +++++----- .../protected/pages/Day1/fr/Setup.page | 7 +-- .../protected/pages/Day1/fr/ShareLayout.page | 4 +- .../protected/pages/Day1/id/CreateContact.page | 31 +++++---- .../protected/pages/Day1/id/Setup.page | 5 +- .../protected/pages/Day1/id/ShareLayout.page | 2 - .../Controls/Samples/TTextHighlighter/Home.page | 1 - .../protected/pages/Controls/TextHighlighter.page | 1 - .../pages/Controls/id/TextHighlighter.page | 1 - .../protected/pages/Tutorial/AjaxChat.page | 1 - .../pages/Tutorial/CurrencyConverter.page | 63 +++++++++---------- .../protected/pages/Tutorial/fr/AjaxChat.page | 1 - .../pages/Tutorial/fr/CurrencyConverter.page | 63 +++++++++---------- .../protected/pages/Tutorial/id/AjaxChat.page | 1 - .../pages/Tutorial/id/CurrencyConverter.page | 73 +++++++++++----------- .../protected/pages/Manual/Tutorial/TestFirst.page | 7 +-- .../pages/Manual/Tutorial/TestSecond.page | 2 - framework/Web/UI/TClientScriptManager.php | 1 - framework/pradolite.php | 29 +++++---- requirements/index.php | 2 - 35 files changed, 169 insertions(+), 223 deletions(-) (limited to 'demos/quickstart/protected/pages/Tutorial') diff --git a/buildscripts/classtree/DWExtension.php b/buildscripts/classtree/DWExtension.php index 8849efea..a7a1ca30 100644 --- a/buildscripts/classtree/DWExtension.php +++ b/buildscripts/classtree/DWExtension.php @@ -252,4 +252,3 @@ class PradoTagChooser return $this->_document->saveXML(); } } -?> \ No newline at end of file diff --git a/buildscripts/index/build.php b/buildscripts/index/build.php index bbe151e6..a2e57286 100644 --- a/buildscripts/index/build.php +++ b/buildscripts/index/build.php @@ -61,5 +61,3 @@ else { echo "Usage: 'php build.php quickstart' or 'php build.php api'\n"; } - -?> diff --git a/buildscripts/index/quickstart_index.php b/buildscripts/index/quickstart_index.php index 61e21514..5df0f549 100644 --- a/buildscripts/index/quickstart_index.php +++ b/buildscripts/index/quickstart_index.php @@ -104,4 +104,3 @@ class quickstart_index echo "\nSaving search index ({$count}) to {$this->_dir}\n\n"; } } -?> \ No newline at end of file diff --git a/buildscripts/index/search.php b/buildscripts/index/search.php index 23948ca5..ff83e629 100644 --- a/buildscripts/index/search.php +++ b/buildscripts/index/search.php @@ -11,7 +11,7 @@ require_once('Zend/Search/Lucene.php'); if($keyword!=='') { - $search=new Zend_Search_Lucene(realpath(dirname(__FILE__))); + $search=new Zend_Search_Lucene(realpath(dirname(__FILE__))); $results=$search->find(strtolower($keyword)); $content=''; foreach($results as $entry) @@ -32,5 +32,3 @@ $page=preg_replace('/.*/ms',$content,$ if($keyword!=='') $page=preg_replace('/ \ No newline at end of file diff --git a/buildscripts/phing/tasks/PradoPearTask.php b/buildscripts/phing/tasks/PradoPearTask.php index 5d615084..541c972e 100644 --- a/buildscripts/phing/tasks/PradoPearTask.php +++ b/buildscripts/phing/tasks/PradoPearTask.php @@ -129,5 +129,3 @@ class PradoPearTask extends Task echo $e->getMessage(); } } - -?> \ No newline at end of file diff --git a/buildscripts/phpbuilder/build.php b/buildscripts/phpbuilder/build.php index 17e02806..47b7bec4 100644 --- a/buildscripts/phpbuilder/build.php +++ b/buildscripts/phpbuilder/build.php @@ -144,5 +144,3 @@ function unfold_file($fileName) } return $content; } - -?> \ No newline at end of file diff --git a/buildscripts/texbuilder/Page2Tex.php b/buildscripts/texbuilder/Page2Tex.php index b0d37149..ce2ece7f 100644 --- a/buildscripts/texbuilder/Page2Tex.php +++ b/buildscripts/texbuilder/Page2Tex.php @@ -343,5 +343,3 @@ class Page2Tex return "

"; } } - -?> diff --git a/buildscripts/texbuilder/quickstart/build.php b/buildscripts/texbuilder/quickstart/build.php index a42d6be3..6a824125 100644 --- a/buildscripts/texbuilder/quickstart/build.php +++ b/buildscripts/texbuilder/quickstart/build.php @@ -76,6 +76,3 @@ if($argv[1] == 'pdf') echo " Unable to find pdfLatex executable $pdflatexExec"; } } - - -?> diff --git a/buildscripts/texbuilder/quickstart/pages.php b/buildscripts/texbuilder/quickstart/pages.php index cd11c4b1..1fb94431 100644 --- a/buildscripts/texbuilder/quickstart/pages.php +++ b/buildscripts/texbuilder/quickstart/pages.php @@ -177,5 +177,3 @@ $pages['Client-side Scripting'] = array( return $pages; //-------------- END CONFIG ---------------- - -?> \ No newline at end of file diff --git a/buildscripts/texbuilder/sqlmap/build.php b/buildscripts/texbuilder/sqlmap/build.php index 4ea4d75e..066af486 100644 --- a/buildscripts/texbuilder/sqlmap/build.php +++ b/buildscripts/texbuilder/sqlmap/build.php @@ -76,6 +76,3 @@ if($argv[1] == 'pdf') echo " Unable to find pdfLatex executable $pdflatexExec"; } } - - -?> diff --git a/buildscripts/texbuilder/sqlmap/pages.php b/buildscripts/texbuilder/sqlmap/pages.php index 57fff767..b0b7bca0 100644 --- a/buildscripts/texbuilder/sqlmap/pages.php +++ b/buildscripts/texbuilder/sqlmap/pages.php @@ -58,5 +58,3 @@ $pages['Advanced Topics'] = array( ); return $pages; - -?> \ No newline at end of file diff --git a/buildscripts/texbuilder/time-tracker/pages.php b/buildscripts/texbuilder/time-tracker/pages.php index 732f675d..a9c32347 100644 --- a/buildscripts/texbuilder/time-tracker/pages.php +++ b/buildscripts/texbuilder/time-tracker/pages.php @@ -14,5 +14,3 @@ $pages['Testing Business Code'] = array( 'Docs/UserClassAndExceptions.page' ); return $pages; - -?> \ No newline at end of file diff --git a/demos/blog-tutorial/protected/pages/Day1/CreateContact.page b/demos/blog-tutorial/protected/pages/Day1/CreateContact.page index 28ad4b21..0d9fc026 100755 --- a/demos/blog-tutorial/protected/pages/Day1/CreateContact.page +++ b/demos/blog-tutorial/protected/pages/Day1/CreateContact.page @@ -45,11 +45,11 @@ We use template to organize the presentational layout of the feedback form. In t

Contact

Please fill out the following form to let me know your feedback on my blog. Thanks!

-<com:TForm> +<com:TForm> Your Name: <com:TRequiredFieldValidator ControlToValidate="Name" - ErrorMessage="Please provide your name." + ErrorMessage="Please provide your name." Display="Dynamic" />
<com:TTextBox ID="Name" /> @@ -57,10 +57,10 @@ We use template to organize the presentational layout of the feedback form. In t
Your Email: <com:TRequiredFieldValidator ControlToValidate="Email" - ErrorMessage="Please provide your email address." + ErrorMessage="Please provide your email address." Display="Dynamic" /> <com:TEmailAddressValidator ControlToValidate="Email" - ErrorMessage="You entered an invalid email address." + ErrorMessage="You entered an invalid email address." Display="Dynamic" />
<com:TTextBox ID="Email" /> @@ -68,11 +68,11 @@ We use template to organize the presentational layout of the feedback form. In t
Feedback: <com:TRequiredFieldValidator ControlToValidate="Feedback" - ErrorMessage="Please provide your feedback." + ErrorMessage="Please provide your feedback." Display="Dynamic" />
-<com:TTextBox ID="Feedback" - TextMode="MultiLine" +<com:TTextBox ID="Feedback" + TextMode="MultiLine" Rows="10" Columns="40" /> @@ -99,13 +99,13 @@ Besides TTextBox controls, the template also uses many validator contro Your Email: -<com:TRequiredFieldValidator +<com:TRequiredFieldValidator ControlToValidate="Email" - ErrorMessage="Please provide your email address." + ErrorMessage="Please provide your email address." Display="Dynamic" /> -<com:TEmailAddressValidator +<com:TEmailAddressValidator ControlToValidate="Email" - ErrorMessage="You entered an invalid email address." + ErrorMessage="You entered an invalid email address." Display="Dynamic" />
<com:TTextBox ID="Email" /> @@ -152,28 +152,27 @@ 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) + * @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; + $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 } } -?>

diff --git a/demos/blog-tutorial/protected/pages/Day1/Setup.page b/demos/blog-tutorial/protected/pages/Day1/Setup.page index e8316253..582d0399 100755 --- a/demos/blog-tutorial/protected/pages/Day1/Setup.page +++ b/demos/blog-tutorial/protected/pages/Day1/Setup.page @@ -52,7 +52,6 @@ require_once('path/to/prado.php'); $application = new TApplication; // run the application and handle user requests $application->run(); -?> @@ -148,8 +147,8 @@ To change the location of the root page directory and change the name of homepag - diff --git a/demos/blog-tutorial/protected/pages/Day1/ShareLayout.page b/demos/blog-tutorial/protected/pages/Day1/ShareLayout.page index 9cd0410b..6115ef22 100755 --- a/demos/blog-tutorial/protected/pages/Day1/ShareLayout.page +++ b/demos/blog-tutorial/protected/pages/Day1/ShareLayout.page @@ -66,7 +66,6 @@ The class file MainLayout.php is very simple: class MainLayout extends TTemplateControl { } -?> @@ -145,7 +144,6 @@ class Contact extends TPage // ... } -?>

diff --git a/demos/blog-tutorial/protected/pages/Day1/fr/CreateContact.page b/demos/blog-tutorial/protected/pages/Day1/fr/CreateContact.page index e85d8bfe..0105f656 100755 --- a/demos/blog-tutorial/protected/pages/Day1/fr/CreateContact.page +++ b/demos/blog-tutorial/protected/pages/Day1/fr/CreateContact.page @@ -45,11 +45,11 @@ Nous utilisons un fichier gabarit pour organiser la présentation de notre formu

Contact

Veuillez remplir le formulaire suivant pour me laisser vos impressions au sujet de mon blog. Merci !

-<com:TForm> +<com:TForm> Votre nom: <com:TRequiredFieldValidator ControlToValidate="Name" - ErrorMessage="Veuillez indiquer votre nom." + ErrorMessage="Veuillez indiquer votre nom." Display="Dynamic" />
<com:TTextBox ID="Name" /> @@ -57,10 +57,10 @@ Nous utilisons un fichier gabarit pour organiser la présentation de notre formu
Votre email: <com:TRequiredFieldValidator ControlToValidate="Email" - ErrorMessage="Veuillez indiquer votre email." + ErrorMessage="Veuillez indiquer votre email." Display="Dynamic" /> <com:TEmailAddressValidator ControlToValidate="Email" - ErrorMessage="Vous avez saisi un email invalide." + ErrorMessage="Vous avez saisi un email invalide." Display="Dynamic" />
<com:TTextBox ID="Email" /> @@ -68,11 +68,11 @@ Nous utilisons un fichier gabarit pour organiser la présentation de notre formu
Commentaires: <com:TRequiredFieldValidator ControlToValidate="Feedback" - ErrorMessage="Veuillez saisir un commentaire." + ErrorMessage="Veuillez saisir un commentaire." Display="Dynamic" />
-<com:TTextBox ID="Feedback" - TextMode="MultiLine" +<com:TTextBox ID="Feedback" + TextMode="MultiLine" Rows="10" Columns="40" /> @@ -99,13 +99,13 @@ Avant le contrôle TTextBox, le gabarit utilise aussi plusieurs validat Your Email: -<com:TRequiredFieldValidator +<com:TRequiredFieldValidator ControlToValidate="Email" - ErrorMessage="Veuillez indiquer votre email." + ErrorMessage="Veuillez indiquer votre email." Display="Dynamic" /> -<com:TEmailAddressValidator +<com:TEmailAddressValidator ControlToValidate="Email" - ErrorMessage="Vous avez saisi un email invalide." + ErrorMessage="Vous avez saisi un email invalide." Display="Dynamic" />
<com:TTextBox ID="Email" /> @@ -152,28 +152,27 @@ class Contact extends TPage /** * Gestionnaire d'évènement pour OnClick (bouton submit). * @param TButton le bouton qui a générer l'évènement - * @param TEventParameter les paramètres de l'évènement (null dans ce cas) + * @param TEventParameter les paramètres de l'évènement (null dans ce cas) */ public function submitButtonClicked($sender, $param) { if ($this->IsValid) // vérifie que les validations sont Ok { // récupère le nom de l'utilisateur, son email et son commentaire - $name = $this->Name->Text; + $name = $this->Name->Text; $email = $this->Email->Text; $feedback = $this->Feedback->Text; - - // envoie un email à l'administrateur avec les informations + + // envoie un email à l'administrateur avec les informations $this->mailFeedback($name, $email, $feedback); } } - + protected function mailFeedback($name, $email, $feedback) { // implémentation de l'envoi de l'email } } -?>

diff --git a/demos/blog-tutorial/protected/pages/Day1/fr/Setup.page b/demos/blog-tutorial/protected/pages/Day1/fr/Setup.page index 22a7891c..0be1c1f0 100755 --- a/demos/blog-tutorial/protected/pages/Day1/fr/Setup.page +++ b/demos/blog-tutorial/protected/pages/Day1/fr/Setup.page @@ -49,11 +49,10 @@ require_once('path/to/prado.php'); $application = new TApplication; // run the application and handle user requests $application->run(); -?> -Le nom du script ne doit pas être obligatoirement index.php. Il peut porter n'importe quel nom à partir du moment ou le serveur peut l'interpréter comme étant un script PHP5. Par exemple, sur certains hébergements mutualisés, le script devra porter le nom index.php5, ce qui permettra au serveur Web de le traiter correctement. +Le nom du script ne doit pas être obligatoirement index.php. Il peut porter n'importe quel nom à partir du moment ou le serveur peut l'interpréter comme étant un script PHP5. Par exemple, sur certains hébergements mutualisés, le script devra porter le nom index.php5, ce qui permettra au serveur Web de le traiter correctement.

Le fichier de configuration de l'application

@@ -145,8 +144,8 @@ Pour changer l'emplacement du dossier racine des pages et le nom de la page d'ac - diff --git a/demos/blog-tutorial/protected/pages/Day1/fr/ShareLayout.page b/demos/blog-tutorial/protected/pages/Day1/fr/ShareLayout.page index cefff770..539b8376 100755 --- a/demos/blog-tutorial/protected/pages/Day1/fr/ShareLayout.page +++ b/demos/blog-tutorial/protected/pages/Day1/fr/ShareLayout.page @@ -68,7 +68,6 @@ Le fichier de classe MainLayout.php est très simple : class MainLayout extends TTemplateControl { } -?> @@ -147,13 +146,12 @@ class Contact extends TPage // ... } -?>

Ci-dessus, nous indiquons d'utiliser le gabarit principal MasterClass dans la méthode onPreInit() qui est héritée de TPage. Cette méthode est appelé par PRADO juste après que l'instance de la page soit créée. Nous pouvons ainsi déclarer au moment où la page est requise quel gabarit principal utiliser. Par exemple, quand la page est requise par un utilisateur enregistré, nous pouvons utiliser le gabarit A, et le gabarit B si l'utilisateur qui demande la page est un invité.

- +

Nous pouvons aussi spécifier quel gabarit principal utiliser dans le fichier de configuration de l'application ou encore dans le fichier de configuration de la page. Ci-dessous, le fichier de configuration de l'application modifié pour notre blog.

diff --git a/demos/blog-tutorial/protected/pages/Day1/id/CreateContact.page b/demos/blog-tutorial/protected/pages/Day1/id/CreateContact.page index 65be6417..caee30d0 100755 --- a/demos/blog-tutorial/protected/pages/Day1/id/CreateContact.page +++ b/demos/blog-tutorial/protected/pages/Day1/id/CreateContact.page @@ -45,11 +45,11 @@ Kita menggunakan template untuk menghatur tata letak penyajian terhadap formulir

Contact

Please fill out the following form to let me know your feedback on my blog. Thanks!

-<com:TForm> +<com:TForm> Your Name: <com:TRequiredFieldValidator ControlToValidate="Name" - ErrorMessage="Please provide your name." + ErrorMessage="Please provide your name." Display="Dynamic" />
<com:TTextBox ID="Name" /> @@ -57,10 +57,10 @@ Kita menggunakan template untuk menghatur tata letak penyajian terhadap formulir
Your Email: <com:TRequiredFieldValidator ControlToValidate="Email" - ErrorMessage="Please provide your email address." + ErrorMessage="Please provide your email address." Display="Dynamic" /> <com:TEmailAddressValidator ControlToValidate="Email" - ErrorMessage="You entered an invalid email address." + ErrorMessage="You entered an invalid email address." Display="Dynamic" />
<com:TTextBox ID="Email" /> @@ -68,11 +68,11 @@ Kita menggunakan template untuk menghatur tata letak penyajian terhadap formulir
Feedback: <com:TRequiredFieldValidator ControlToValidate="Feedback" - ErrorMessage="Please provide your feedback." + ErrorMessage="Please provide your feedback." Display="Dynamic" />
-<com:TTextBox ID="Feedback" - TextMode="MultiLine" +<com:TTextBox ID="Feedback" + TextMode="MultiLine" Rows="10" Columns="40" /> @@ -99,13 +99,13 @@ Selain kontrol TTextBox, template juga menggunakan banyak kontrol valid Your Email: -<com:TRequiredFieldValidator +<com:TRequiredFieldValidator ControlToValidate="Email" - ErrorMessage="Please provide your email address." + ErrorMessage="Please provide your email address." Display="Dynamic" /> -<com:TEmailAddressValidator +<com:TEmailAddressValidator ControlToValidate="Email" - ErrorMessage="You entered an invalid email address." + ErrorMessage="You entered an invalid email address." Display="Dynamic" />
<com:TTextBox ID="Email" /> @@ -152,28 +152,27 @@ class Contact extends TPage /** * Pengendali event untuk event OnClick pada tombol submit. * @param TButton tombol yang memicu event - * @param TEventParameter parameter event (null di sini) + * @param TEventParameter parameter event (null di sini) */ public function submitButtonClicked($sender, $param) { if ($this->IsValid) // memeriksa apakan validasi input berhasil { // mendapatkan nama pengguna, email, umpan balik dari kotak teks - $name = $this->Name->Text; + $name = $this->Name->Text; $email = $this->Email->Text; $feedback = $this->Feedback->Text; - + // mengirimkan email ke administrator dengan informasi di atas $this->mailFeedback($name, $email, $feedback); } } - + protected function mailFeedback($name, $email, $feedback) { // implementasi pengiriman email umpan balik } } -?>

diff --git a/demos/blog-tutorial/protected/pages/Day1/id/Setup.page b/demos/blog-tutorial/protected/pages/Day1/id/Setup.page index edc469d5..45ae8cf5 100755 --- a/demos/blog-tutorial/protected/pages/Day1/id/Setup.page +++ b/demos/blog-tutorial/protected/pages/Day1/id/Setup.page @@ -52,7 +52,6 @@ require_once('path/to/prado.php'); $application = new TApplication; // jalankan aplikasi dan tangani permintaan pengguna $application->run(); -?> @@ -148,8 +147,8 @@ Untuk membuat lokasi akar direktori halaman dan mengubah nama homepage, seseoran - diff --git a/demos/blog-tutorial/protected/pages/Day1/id/ShareLayout.page b/demos/blog-tutorial/protected/pages/Day1/id/ShareLayout.page index d505beed..0c40181b 100755 --- a/demos/blog-tutorial/protected/pages/Day1/id/ShareLayout.page +++ b/demos/blog-tutorial/protected/pages/Day1/id/ShareLayout.page @@ -66,7 +66,6 @@ File kelas MainLayout.php sangat sederhana: class MainLayout extends TTemplateControl { } -?> @@ -145,7 +144,6 @@ class Contact extends TPage // ... } -?>

diff --git a/demos/quickstart/protected/pages/Controls/Samples/TTextHighlighter/Home.page b/demos/quickstart/protected/pages/Controls/Samples/TTextHighlighter/Home.page index 9bd86078..c7506c67 100755 --- a/demos/quickstart/protected/pages/Controls/Samples/TTextHighlighter/Home.page +++ b/demos/quickstart/protected/pages/Controls/Samples/TTextHighlighter/Home.page @@ -12,7 +12,6 @@ Highlighting PHP statements: $str = 'one|two|three|four'; // will output an array print_r(explode('|', $str, 2)); -?> diff --git a/demos/quickstart/protected/pages/Controls/TextHighlighter.page b/demos/quickstart/protected/pages/Controls/TextHighlighter.page index 1babbb33..5d3428f9 100755 --- a/demos/quickstart/protected/pages/Controls/TextHighlighter.page +++ b/demos/quickstart/protected/pages/Controls/TextHighlighter.page @@ -17,7 +17,6 @@ To use TTextHighlighter, simply enclose the contents to be syntax highl </com:TTextHighlighter> diff --git a/demos/quickstart/protected/pages/Controls/id/TextHighlighter.page b/demos/quickstart/protected/pages/Controls/id/TextHighlighter.page index b2b500b0..b1bb4ce7 100755 --- a/demos/quickstart/protected/pages/Controls/id/TextHighlighter.page +++ b/demos/quickstart/protected/pages/Controls/id/TextHighlighter.page @@ -17,7 +17,6 @@ Untuk menggunakan TTextHighlighter, cukup kurung konten yang sintaksnya </com:TTextHighlighter> diff --git a/demos/quickstart/protected/pages/Tutorial/AjaxChat.page b/demos/quickstart/protected/pages/Tutorial/AjaxChat.page index 4a8f23ab..92118720 100755 --- a/demos/quickstart/protected/pages/Tutorial/AjaxChat.page +++ b/demos/quickstart/protected/pages/Tutorial/AjaxChat.page @@ -59,7 +59,6 @@ php prado/framework/prado-cli.php -c chat class Login extends TPage { } -?> currency-converter in your current working directory. You may need to change to the appropriate directory first. - See the Command Line Tool - for more details. -

+ See the Command Line Tool + for more details. +

php prado/framework/prado-cli.php -c currency-converter @@ -52,7 +52,7 @@ php prado/framework/prado-cli.php -c currency-converter

We start by editing the Home.page file found in the currency-converter/protected/pages/ directory. Files ending with ".page" are page templates that contains HTML and Prado controls. - We simply add two textboxes, three labels and one button as follows. + We simply add two textboxes, three labels and one button as follows.

<com:TForm> @@ -75,7 +75,7 @@ php prado/framework/prado-cli.php -c currency-converter
</com:TForm> - +

If you refresh the page, you should see something similar to the following figure. It may not look very pretty or orderly, but we shall change that later using CSS. @@ -125,7 +125,7 @@ php prado/framework/prado-cli.php -c currency-converter to add a "Home.php" to where "Home.page" is. The Home class should extends the , the default base - class for all Prado pages. + class for all Prado pages.

<?php @@ -133,8 +133,7 @@ class Home extends TPage { } -?> - +

Prado uses PHP's __autoload method to load classes. The convention is to use the class name with ".php" extension as filename. @@ -151,15 +150,15 @@ class Home extends TPage the converted total. To handle the user clicking of the "Convert" button we simply add an OnClick property to the "Convert" button in the "Home.page" template and add a corresponding event handler method - in the "Home.php". + in the "Home.php".

<com:TButton Text="Convert" OnClick="convert_clicked" /> -

+

The value of the OnClick, "convert_clicked", will be the method name in the "Home.php" that will called when the user clicks on the - "Convert" button. + "Convert" button.

class Home extends TPage @@ -171,8 +170,8 @@ class Home extends TPage $this->total->Text = $rate * $dollars; } } - -
+ +

If you run the application in your web browser, enter some values and click the "Convert" button then you should see that calculated value displayed next @@ -186,24 +185,24 @@ class Home extends TPage

We shall now examine, the three lines that implements the simply currency - conversion in the "convert_clicked" method. -

+ conversion in the "convert_clicked" method. +

$rate = floatval($this->currencyRate->Text); - +

The statement $this->currencyRate corresponds to the TTextBox component with ID value "currencyRate" in the "Home.page" template. The Text property of the TTextBox contains the value that the user entered. So, we obtain this value by $this->currencyRate->Text which we convert the - value to a float value. + value to a float value.

$dollars = floatval($this->dollars->Text); - -
+ +

The next line does a similar things, it takes the user value from the TTextBox with ID value "dollars and converts it to @@ -212,9 +211,9 @@ $dollars = floatval($this->dollars->Text);

The third line calculates the new amount and set this value in the Text property of the TLabel with ID="total". - Thus, we display the new amount to the user in the label. + Thus, we display the new amount to the user in the label.

-
+
$this->total->Text = $rate * $dollars; @@ -233,14 +232,14 @@ $this->total->Text = $rate * $dollars;
  • the user enters a value,
  • the currency rate is a valid number,
  • the currency rate is positive.
  • - +

    To ensure 1 we add one . To ensure 2 and 3, we add one . We may add these validators any where within the "Home.page" template. Further details regarding these validator and other validators can be found in the - Validation Controls page. + Validation Controls page.

    <com:TRequiredFieldValidator @@ -258,12 +257,12 @@ $this->total->Text = $rate * $dollars;
    1. the user enters a value,
    2. the value is a valid number (not including any currency or dollar signs).
    3. -
    +

    To ensure 1 we just add another TRequiredFieldValidator, for 2 we could use a . For simplicity we only allow the user to enter - a number for the amount they wish to convert. + a number for the amount they wish to convert.

    <com:TRequiredFieldValidator @@ -283,7 +282,7 @@ $this->total->Text = $rate * $dollars; using both javascript and server side. The server side validation is always performed. For the server side, we should skip the calculation if the validators are not satisfied. This can - done as follows. + done as follows.

    public function convert_clicked($sender, $param) @@ -313,7 +312,7 @@ public function convert_clicked($sender, $param) In addition, we can change the "totals" TLabel with the Active Control counter part, , such that the server side can update the browser without - reloading the page. + reloading the page.

    @@ -323,11 +322,11 @@ public function convert_clicked($sender, $param)
    <com:TActiveButton Text="Convert" OnClick="convert_clicked" />
    - +

    The server side logic remains the same, we just need to import the Active Controls name space as they are not included by default. We - add the following line to the begin of "Home.php". + add the following line to the begin of "Home.php".

    Prado::using('System.Web.UI.ActiveControls.*'); @@ -345,7 +344,7 @@ Prado::using('System.Web.UI.ActiveControls.*');

    To indicate that the calculation is in progress, we can change the text of the "total" label as follows. We add a ClientSide.OnLoading property to the "Convert" button (since this button is responsible for requesting - the calculation). + the calculation).

    <com:TActiveButton Text="Convert" OnClick="convert_clicked" > @@ -383,7 +382,7 @@ Prado::using('System.Web.UI.ActiveControls.*');

    We simply create a CSS file named "common.css" and save it in the themes/Basic directory. Then we add the following code - to the beginning of "Home.page" (we add a little more HTML as well). + to the beginning of "Home.page" (we add a little more HTML as well).

    <%@ Theme="Basic" %> @@ -392,7 +391,7 @@ Prado::using('System.Web.UI.ActiveControls.*'); <com:THead Title="Currency Converter" /> - +

    The first line <%@ Theme="Basic" %> defines the theme to be used for this page. The diff --git a/demos/quickstart/protected/pages/Tutorial/fr/AjaxChat.page b/demos/quickstart/protected/pages/Tutorial/fr/AjaxChat.page index 39d7f9e5..568e920f 100755 --- a/demos/quickstart/protected/pages/Tutorial/fr/AjaxChat.page +++ b/demos/quickstart/protected/pages/Tutorial/fr/AjaxChat.page @@ -58,7 +58,6 @@ php prado/framework/prado-cli.php -c chat class Login extends TPage { } -?> currency-converter in your current working directory. You may need to change to the appropriate directory first. - See the Command Line Tool - for more details. -

    + See the Command Line Tool + for more details. +

    php prado/framework/prado-cli.php -c currency-converter @@ -52,7 +52,7 @@ php prado/framework/prado-cli.php -c currency-converter

    We start by editing the Home.page file found in the currency-converter/protected/pages/ directory. Files ending with ".page" are page templates that contains HTML and Prado controls. - We simply add two textboxes, three labels and one button as follows. + We simply add two textboxes, three labels and one button as follows.

    <com:TForm> @@ -75,7 +75,7 @@ php prado/framework/prado-cli.php -c currency-converter
    </com:TForm> -
    +

    If you refresh the page, you should see something similar to the following figure. It may not look very pretty or orderly, but we shall change that later using CSS. @@ -125,7 +125,7 @@ php prado/framework/prado-cli.php -c currency-converter to add a "Home.php" to where "Home.page" is. The Home class should extends the , the default base - class for all Prado pages. + class for all Prado pages.

    <?php @@ -133,8 +133,7 @@ class Home extends TPage { } -?> - +

    Prado uses PHP's __autoload method to load classes. The convention is to use the class name with ".php" extension as filename. @@ -151,15 +150,15 @@ class Home extends TPage the converted total. To handle the user clicking of the "Convert" button we simply add an OnClick property to the "Convert" button in the "Home.page" template and add a corresponding event handler method - in the "Home.php". + in the "Home.php".

    <com:TButton Text="Convert" OnClick="convert_clicked" /> -

    +

    The value of the OnClick, "convert_clicked", will be the method name in the "Home.php" that will called when the user clicks on the - "Convert" button. + "Convert" button.

    class Home extends TPage @@ -171,8 +170,8 @@ class Home extends TPage $this->total->Text = $rate * $dollars; } } - -
    + +

    If you run the application in your web browser, enter some values and click the "Convert" button then you should see that calculated value displayed next @@ -186,24 +185,24 @@ class Home extends TPage

    We shall now examine, the three lines that implements the simply currency - conversion in the "convert_clicked" method. -

    + conversion in the "convert_clicked" method. +

    $rate = floatval($this->currencyRate->Text); - +

    The statement $this->currencyRate corresponds to the TTextBox component with ID value "currencyRate" in the "Home.page" template. The Text property of the TTextBox contains the value that the user entered. So, we obtain this value by $this->currencyRate->Text which we convert the - value to a float value. + value to a float value.

    $dollars = floatval($this->dollars->Text); - -
    + +

    The next line does a similar things, it takes the user value from the TTextBox with ID value "dollars and converts it to @@ -212,9 +211,9 @@ $dollars = floatval($this->dollars->Text);

    The third line calculates the new amount and set this value in the Text property of the TLabel with ID="total". - Thus, we display the new amount to the user in the label. + Thus, we display the new amount to the user in the label.

    -
    +
    $this->total->Text = $rate * $dollars; @@ -233,14 +232,14 @@ $this->total->Text = $rate * $dollars;
  • the user enters a value,
  • the currency rate is a valid number,
  • the currency rate is positive.
  • - +

    To ensure 1 we add one . To ensure 2 and 3, we add one . We may add these validators any where within the "Home.page" template. Further details regarding these validator and other validators can be found in the - Validation Controls page. + Validation Controls page.

    <com:TRequiredFieldValidator @@ -258,12 +257,12 @@ $this->total->Text = $rate * $dollars;
    1. the user enters a value,
    2. the value is a valid number (not including any currency or dollar signs).
    3. -
    +

    To ensure 1 we just add another TRequiredFieldValidator, for 2 we could use a . For simplicity we only allow the user to enter - a number for the amount they wish to convert. + a number for the amount they wish to convert.

    <com:TRequiredFieldValidator @@ -283,7 +282,7 @@ $this->total->Text = $rate * $dollars; using both javascript and server side. The server side validation is always performed. For the server side, we should skip the calculation if the validators are not satisfied. This can - done as follows. + done as follows.

    public function convert_clicked($sender, $param) @@ -310,7 +309,7 @@ public function convert_clicked($sender, $param) In addition, we can change the "totals" TLabel with the Active Control counter part, , such that the server side can update the browser without - reloading the page. + reloading the page.

    @@ -320,11 +319,11 @@ public function convert_clicked($sender, $param)
    <com:TActiveButton Text="Convert" OnClick="convert_clicked" />
    - +

    The server side logic remains the same, we just need to import the Active Controls name space as they are not included by default. We - add the following line to the begin of "Home.php". + add the following line to the begin of "Home.php".

    Prado::using('System.Web.UI.ActiveControls.*'); @@ -342,7 +341,7 @@ Prado::using('System.Web.UI.ActiveControls.*');

    To indicate that the calculation is in progress, we can change the text of the "total" label as follows. We add a ClientSide.OnLoading property to the "Convert" button (since this button is responsible for requesting - the calculation). + the calculation).

    <com:TActiveButton Text="Convert" OnClick="convert_clicked" > @@ -380,7 +379,7 @@ Prado::using('System.Web.UI.ActiveControls.*');

    We simply create a CSS file named "common.css" and save it in the themes/Basic directory. Then we add the following code - to the beginning of "Home.page" (we add a little more HTML as well). + to the beginning of "Home.page" (we add a little more HTML as well).

    <%@ Theme="Basic" %> @@ -389,7 +388,7 @@ Prado::using('System.Web.UI.ActiveControls.*'); <com:THead Title="Currency Converter" /> - +

    The first line <%@ Theme="Basic" %> defines the theme to be used for this page. The diff --git a/demos/quickstart/protected/pages/Tutorial/id/AjaxChat.page b/demos/quickstart/protected/pages/Tutorial/id/AjaxChat.page index 00222bca..50759868 100755 --- a/demos/quickstart/protected/pages/Tutorial/id/AjaxChat.page +++ b/demos/quickstart/protected/pages/Tutorial/id/AjaxChat.page @@ -55,7 +55,6 @@ php prado/framework/prado-cli.php -c chat class Login extends TPage { } -?>

    Membangun Pengubah Kurs Sederhana

    Tutorial ini memperkenalkan kerangka kerja aplikasi web Prado dan mengajarkan Anda bagaimana untuk - membangun aplikasi web sederhana dalam beberapa langkah sederhana. Tutorial - ini menganggap bahwa Anda terbiasa dengan PHP dan Anda telah mengakses + membangun aplikasi web sederhana dalam beberapa langkah sederhana. Tutorial + ini menganggap bahwa Anda terbiasa dengan PHP dan Anda telah mengakses server web yang dapat melayani naskah PHP5.

    @@ -25,9 +25,9 @@

    Cara tercepat dan termudah untuk membuat aplikasi web Prado baru adalah menggunakan piranti perintah prado-cli.php yang ditemukan dalam direktori framework pada distribusi Prado. Kita membuat aplikasi baru dengan menjalankan perintah berikut dalam prompt perintah atau konsol Anda. Perintah membuat direktori baru bernama currency-converter dalam direktori kerja Anda saat ini. Anda perlu mengubahnya ke direktori yang benar terlebih dahulu. - Lihat Piranti Baris Perintah - untuk lebih jelasnya. -

    + Lihat Piranti Baris Perintah + untuk lebih jelasnya. +

    php prado/framework/prado-cli.php -c currency-converter @@ -39,7 +39,7 @@ php prado/framework/prado-cli.php -c currency-converter

    Membuat Antarmuka Pengguna Pengubah Kurs

    Kita mulai dengan mengedit file Home.page yang ditemukan dalam direktori currency-converter/protected/pages/. File yang berakhiran dengan ".page" adalah template halaman yang berisi HTML dan kontrol Prado. - Kita cukup menambah dua kotak teks, tiga label dan satu tombol seperti berikut. + Kita cukup menambah dua kotak teks, tiga label dan satu tombol seperti berikut.

    <com:TForm> @@ -62,7 +62,7 @@ php prado/framework/prado-cli.php -c currency-converter
    </com:TForm> -
    +

    Jika Anda menyegarkan halaman, Anda akan melihat sesuatu mirip dengan gambar berikut. Ia mungkin terlihat tidak cukup bagus atau berurut, tapi kita akan mengubahnya nanti dengan menggunakan CSS. @@ -82,7 +82,7 @@ php prado/framework/prado-cli.php -c currency-converter yang pada dasarnya mendefinisikan sebuah label dan kotak teks bagi pengguna aplikasi untuk memasukan nilai pertukaran kurs. - Nilai properti ForControl property menentukan komponen mana label + Nilai properti ForControl property menentukan komponen mana label diperuntukan. Ini membolehkan pengguna aplikasi mengklik pada label untuk memfokuskan pada field (hal yang baik). Anda mungkin telah menggunakan elemen biasa HTML <label> untuk melakukan hal yang sama, tapi @@ -109,7 +109,7 @@ php prado/framework/prado-cli.php -c currency-converter

    Jika Anda mencoba mengklik pada tombol "Convert" kemudian halaman akan menyegarkan dan tidak melakukan apapun. Agar tombol melakukan beberapa pekerjaan, kita perlu menambahkan "Home.php" ke di mana "Home.page" berada. Kelas Home harus - memperluas , basis kelas standar untuk semua halaman Prado. + memperluas , basis kelas standar untuk semua halaman Prado.

    <?php @@ -117,8 +117,7 @@ class Home extends TPage { } -?> - +

    Prado menggunakan metode PHP __autoload untuk mengambil kelas. Konvensi adalah untuk menggunakan nama kelas dengan ekstensi ".php" sebagai nama file. @@ -134,14 +133,14 @@ class Home extends TPage nilai dalam kotak teks, melakukan beberapa perhitungan dan menyajikan kepada pengguna dengan total nilai yang dikonversi. Untuk menangani pengguna mengklik pada tombo "Convert", kita cukup menambahkan sebuah properti OnClick ke tombol "Convert" dalam - template "Home.page" dan menambahkan metode pengendali event terkait dalam "Home.php". + template "Home.page" dan menambahkan metode pengendali event terkait dalam "Home.php".

    <com:TButton Text="Convert" OnClick="convert_clicked" /> -

    +

    Nilai dari OnClick, "convert_clicked", akan menjadi nama metode - dalam "Home.php" yang akan dipanggil saat pengguna mengklik tombol "Convert". + dalam "Home.php" yang akan dipanggil saat pengguna mengklik tombol "Convert".

    class Home extends TPage @@ -153,8 +152,8 @@ class Home extends TPage $this->total->Text = $rate * $dollars; } } - -
    + +

    Jika Anda menjalankan aplikasi dalam web browser Anda, masukkan beberapa nilai dan klik tombol "Convert" kemudian Anda akan melihat nilai yang dihitung ditampilkan @@ -168,24 +167,24 @@ class Home extends TPage

    Sekarang kita akan memeriksa, tiga baris yang mengimplementasikan konversi - kurs sederhana dalam metode "convert_clicked". -

    + kurs sederhana dalam metode "convert_clicked". +

    $rate = floatval($this->currencyRate->Text); - +

    Pernyataan $this->currencyRate berhubungan dengan komponen TTextBox dengan nilai ID "currencyRate" dalam template "Home.page". Properti Text dari TTextBox berisi nilai yang dimasukan oleh pengguna. Maka kita memperoleh nilai ini dengan $this->currencyRate->Text yang kita konversi nilainya ke nilai - pecahan. + pecahan.

    $dollars = floatval($this->dollars->Text); - -
    + +

    Baris berikutnya melakukan hal yang mirip, ia mengambil nilai pengguna dari TTextBox dengan nilai ID "dollars dang mengubahnya @@ -194,9 +193,9 @@ $dollars = floatval($this->dollars->Text);

    Baris ketiga menghitung jumlah baru dan menyetel nilai ini dalam properti Text dari TLabel dengan ID="total". - Selanjutnya, kita tampilkan jumlah baru ke pengguna dalam label. + Selanjutnya, kita tampilkan jumlah baru ke pengguna dalam label.

    -
    +
    $this->total->Text = $rate * $dollars; @@ -210,11 +209,11 @@ $this->total->Text = $rate * $dollars;
  • pengguna memasukan sebuah nilai,
  • kurs mata uang adalah angka yang benar,
  • kurs mata uang adalah positif.
  • - +

    Untuk memastikan poin 1 kita menambahkan satu . Untuk memastikan poin 2 dan 3, kita menambahkan satu . Kita dapat menambahkan validator ini di mana saja di dalam template "Home.page". Perincian selanjutnya mengenai validator ini dan validator lainnya dapat ditemukan dalam halaman - Validation Controls. + Validation Controls.

    <com:TRequiredFieldValidator @@ -232,11 +231,11 @@ $this->total->Text = $rate * $dollars;
    1. pengguna memasukan sebuah nilai,
    2. nilai adalah angka yang benar (tidak menyertakan tanda kurs atau dolar).
    3. -
    +

    Untuk memastikan 1 kita cukup menambahkan TRequiredFieldValidator lainnya, untuk 2 kita dapat menggunakan - . Untuk memudahkan kita hanya membolehkan pengguna untuk memasukan sebuah angka untuk jumlah yang ingin mereka ubah. + . Untuk memudahkan kita hanya membolehkan pengguna untuk memasukan sebuah angka untuk jumlah yang ingin mereka ubah.

    <com:TRequiredFieldValidator @@ -249,8 +248,8 @@ $this->total->Text = $rate * $dollars;

    -

    Sekarang jika Anda mencoba memasukan beberapa data tidak benar dalam aplikasi atau membiarkan field kosong - validators akan diaktifkan dan menyajikan pesan kesalahan kepada pengguna. Catatan bahwa pesan kesalahan disajikan tanpa mengambil ulang halaman. Validator Prado standarnya memvalidasi javascript dan di dalam server. Validasi di dalam server selalu dilakukan. Untuk sisi server, kita harus melewati perhitungan jika validator tidak memuaskan. Ini dapat dilakukan seperti berikut. +

    Sekarang jika Anda mencoba memasukan beberapa data tidak benar dalam aplikasi atau membiarkan field kosong + validators akan diaktifkan dan menyajikan pesan kesalahan kepada pengguna. Catatan bahwa pesan kesalahan disajikan tanpa mengambil ulang halaman. Validator Prado standarnya memvalidasi javascript dan di dalam server. Validasi di dalam server selalu dilakukan. Untuk sisi server, kita harus melewati perhitungan jika validator tidak memuaskan. Ini dapat dilakukan seperti berikut.

    public function convert_clicked($sender, $param) @@ -276,7 +275,7 @@ memperbaiki pengalaman pengguna dengan meningkatkan tanggapan aplikasi. Satu car , yang dapat memicu event klik di dalam server tanpa mengambil ulang halaman. Sebagai tambahan, kita dapat mengubah "total" TLabel dengan pasangan Kontrol Aktif, - , dengan demikian di dalam server dapat memutakhirkan browser tanpa mengambil ulang halaman. + , dengan demikian di dalam server dapat memutakhirkan browser tanpa mengambil ulang halaman.

    @@ -286,10 +285,10 @@ memperbaiki pengalaman pengguna dengan meningkatkan tanggapan aplikasi. Satu car
    <com:TActiveButton Text="Convert" OnClick="convert_clicked" />
    - +

    Logika di dalam server tetap sama, kita hanya perlu mengimpor - ruang nama Kontrol Aktif karena secara standar tidak disertakan. Kita menambahkan baris berikut ke awal "Home.php". + ruang nama Kontrol Aktif karena secara standar tidak disertakan. Kita menambahkan baris berikut ke awal "Home.php".

    Prado::using('System.Web.UI.ActiveControls.*'); @@ -300,7 +299,7 @@ Prado::using('System.Web.UI.ActiveControls.*'); Selanjutnya kita bisa memperbaiki pengalaman pengguna dengan mengunah label teks "total" menjadi "calculating..." saat pengguna mengklik tombol "Convert". Label teks "total" masih dimutakhirkan dengan jumlah perhitungan baru seperti sebelumnya.

    -

    Untuk mengindikasikan bahwa perhitungan sedang berlangsung, kita dapat mengubah label teks "total" sebagai berikut. Kita menambahkan properti ClientSide.OnLoading ke tombol "Convert" (karena tombol ini bertanggung jawab terhadap permintaan perhitungan). +

    Untuk mengindikasikan bahwa perhitungan sedang berlangsung, kita dapat mengubah label teks "total" sebagai berikut. Kita menambahkan properti ClientSide.OnLoading ke tombol "Convert" (karena tombol ini bertanggung jawab terhadap permintaan perhitungan).

    <com:TActiveButton Text="Convert" OnClick="convert_clicked" > @@ -325,7 +324,7 @@ Prado::using('System.Web.UI.ActiveControls.*');

    Kita cukup dengan membuat file CSS bernama "common.css" dan menyimpannya dalam direktori - themes/Basic. Kemudian kita menambahkan kode berikut ke awal "Home.page" (kita menambahkan sedikit kode HTML juga). + themes/Basic. Kemudian kita menambahkan kode berikut ke awal "Home.page" (kita menambahkan sedikit kode HTML juga).

    <%@ Theme="Basic" %> @@ -334,10 +333,10 @@ Prado::using('System.Web.UI.ActiveControls.*'); <com:THead Title="Currency Converter" /> - +

    Baris pertama <%@ Theme="Basic" %> mendefinisikan tema - yang dipakai untuk halaman ini. + yang dipakai untuk halaman ini. merujuk ke elemen HTML <head>. Sebagai tambahan terhadap tampilan properti Title pada THead, semua file CSS diff --git a/demos/sqlmap/protected/pages/Manual/Tutorial/TestFirst.page b/demos/sqlmap/protected/pages/Manual/Tutorial/TestFirst.page index 80a155cb..55d55c31 100755 --- a/demos/sqlmap/protected/pages/Manual/Tutorial/TestFirst.page +++ b/demos/sqlmap/protected/pages/Manual/Tutorial/TestFirst.page @@ -46,7 +46,6 @@ class PersonTest extends UnitTestCase $this->assertNotNull($person, "Person not returned"); } } -?>

    Well, the example sure looks easy enough! We ask a method to "select all", and @@ -54,7 +53,7 @@ it returns a list of person objects. But, what code do we need to write to pass this test?

    Note: - Save the PersonTest.php into a tests directory. + Save the PersonTest.php into a tests directory. The unit tests are written for the SimpleTest Unit Testing framework.
    @@ -74,7 +73,6 @@ error_reporting(E_ALL); $test = new GroupTest('All tests'); $test->addTestFile('Tests/PersonTest.php'); $test->run(new HtmlReporter()); -?>

    To run the tests, point your browser to the "run_test.php" script file @@ -108,7 +106,6 @@ class Person $this->_birthDate = $value; } } -?>

    OK, that was fun! The $this->assertXXX(...) methods are built into @@ -125,7 +122,7 @@ method executes our SQL statement (or stored procedure) and returns the result as a list. Each row in the result becomes an entry in the list. Along with queryForList(), there are also delete(), insert(), queryForObject(), queryForPagedList() and a few other methods in the -SQLMap API. +SQLMap API.

    Looking at unit test example, we see that the queryForList() method takes the name of the statement we want to run. OK. Easy enough. But where diff --git a/demos/sqlmap/protected/pages/Manual/Tutorial/TestSecond.page b/demos/sqlmap/protected/pages/Manual/Tutorial/TestSecond.page index 706b5220..b128c413 100755 --- a/demos/sqlmap/protected/pages/Manual/Tutorial/TestSecond.page +++ b/demos/sqlmap/protected/pages/Manual/Tutorial/TestSecond.page @@ -58,7 +58,6 @@ error_reporting(E_ALL); require_once('/path/to/prado/framework/prado.php'); $application=new TApplication; $application->run(); -?>

    Now we are ready to setup a page to display our list of people. @@ -106,7 +105,6 @@ class Home extends TPage $this->loadData(); } } -?>

    If we run this now, we'll get a list like the one shown the figure below.

    diff --git a/framework/Web/UI/TClientScriptManager.php b/framework/Web/UI/TClientScriptManager.php index 2a8ae6ae..cc59292a 100644 --- a/framework/Web/UI/TClientScriptManager.php +++ b/framework/Web/UI/TClientScriptManager.php @@ -367,7 +367,6 @@ class TClientScriptManager extends TApplicationComponent * $this->Page->ClientScript->registerStyleSheetFile($url, $url); * } * } - * ?> * * * @param string a unique key identifying the file diff --git a/framework/pradolite.php b/framework/pradolite.php index d9627d13..dfe5e1d2 100644 --- a/framework/pradolite.php +++ b/framework/pradolite.php @@ -1248,7 +1248,7 @@ class TTextWriter extends TComponent implements ITextWriter $this->write($str."\n"); } } -class TPriorityList extends TList +class TPriorityList extends TList { private $_d=array(); private $_o=false; @@ -1483,7 +1483,7 @@ class TPriorityList extends TList foreach($this->_d as $priority=>$items) { if(($index=array_search($item,$items,true))!==false) { $absindex+=$index; - return $withindex?array($priority,$index,$absindex, + return $withindex?array($priority,$index,$absindex, 'priority'=>$priority,'index'=>$index,'absindex'=>$absindex):$priority; } else $absindex+=count($items); @@ -1500,7 +1500,7 @@ class TPriorityList extends TList if($index>=($c=count($items))) $index-=$c; else - return $withindex?array($priority,$index,$absindex, + return $withindex?array($priority,$index,$absindex, 'priority'=>$priority,'index'=>$index,'absindex'=>$absindex):$priority; } return false; @@ -3129,7 +3129,7 @@ class THttpRequest extends TApplicationComponent implements IteratorAggregate,Ar if($this->getEnableCache()) { $cache = $this->getApplication()->getCache(); - if($cache !== null) + if($cache !== null) { $dependencies = null; if($this->getApplication()->getMode() !== TApplicationMode::Performance) @@ -4524,7 +4524,7 @@ class TControl extends TApplicationComponent implements IRenderable, IBindable const IS_DISABLE_THEMING=0x10; const IS_CHILD_CREATED=0x20; const IS_CREATING_CHILD=0x40; - const RF_CONTROLS=0; const RF_CHILD_STATE=1; const RF_NAMED_CONTROLS=2; const RF_NAMED_CONTROLS_ID=3; const RF_SKIN_ID=4; const RF_DATA_BINDINGS=5; const RF_EVENTS=6; const RF_CONTROLSTATE=7; const RF_NAMED_OBJECTS=8; const RF_ADAPTER=9; const RF_AUTO_BINDINGS=10; + const RF_CONTROLS=0; const RF_CHILD_STATE=1; const RF_NAMED_CONTROLS=2; const RF_NAMED_CONTROLS_ID=3; const RF_SKIN_ID=4; const RF_DATA_BINDINGS=5; const RF_EVENTS=6; const RF_CONTROLSTATE=7; const RF_NAMED_OBJECTS=8; const RF_ADAPTER=9; const RF_AUTO_BINDINGS=10; private $_id=''; private $_uid; private $_parent; @@ -6385,7 +6385,7 @@ class TWebControlDecorator extends TComponent { $this->_posttagtemplate = $value; } public function instantiate($outercontrol = null) { - if($this->getPreTagTemplate() || $this->getPreContentsTemplate() || + if($this->getPreTagTemplate() || $this->getPreContentsTemplate() || $this->getPostContentsTemplate() || $this->getPostTagTemplate()) { $this->_outercontrol = $outercontrol; if($this->getUseState()) @@ -6684,7 +6684,7 @@ class TWebControl extends TControl implements IStyleable $decorator->renderPostContentsText($writer); $writer->renderEndTag(); $decorator->renderPostTagText($writer); - } else + } else $writer->renderEndTag($writer); } } @@ -7306,7 +7306,7 @@ class TClientScriptManager extends TApplicationComponent if($str!=='') $writer->write("
    \n".$str."
    \n"); } - public function getHiddenFields() + public function getHiddenFields() { return $this->_hiddenFields; } @@ -9672,7 +9672,7 @@ class TPageConfiguration extends TComponent $this->loadFromPhp($fcontent,dirname($fname),$configPagePath); } else - { + { $dom=new TXmlDocument; if($dom->loadFromFile($fname)) $this->loadFromXml($dom,dirname($fname),$configPagePath); @@ -9759,7 +9759,7 @@ class TPageConfiguration extends TComponent if(isset($page['properties'])) { $properties=$page['properties']; - unset($page['properties']); + unset($page['properties']); } $matching=false; $id=($configPagePath==='')?$id:$configPagePath.'.'.$id; @@ -10173,7 +10173,7 @@ class TApplication extends TComponent const STATE_PERFORMANCE='Performance'; const PAGE_SERVICE_ID='page'; const CONFIG_FILE_XML='application.xml'; - const CONFIG_FILE_EXT_XML='.xml'; + const CONFIG_FILE_EXT_XML='.xml'; const CONFIG_TYPE_XML = 'xml'; const CONFIG_FILE_PHP='application.php'; const CONFIG_FILE_EXT_PHP='.php'; @@ -10822,7 +10822,7 @@ class TApplicationConfiguration extends TComponent $this->_properties[$name]=$value; } $this->_empty = false; - } + } if(isset($config['paths']) && is_array($config['paths'])) $this->loadPathsPhp($config['paths'],$configPath); if(isset($config['modules']) && is_array($config['modules'])) @@ -10946,7 +10946,7 @@ class TApplicationConfiguration extends TComponent $properties['id'] = $id; $this->_modules[$id]=array($type,$properties,$module); $this->_empty=false; - } + } } protected function loadModulesXml($modulesNode,$configPath) { @@ -10982,7 +10982,7 @@ class TApplicationConfiguration extends TComponent $properties['id'] = $id; $this->_services[$id] = array($type,$properties,$service); $this->_empty = false; - } + } } protected function loadServicesXml($servicesNode,$configPath) { @@ -11152,4 +11152,3 @@ class TShellApplication extends TApplication $this->initApplication(); } } -?> \ No newline at end of file diff --git a/requirements/index.php b/requirements/index.php index 58fb1ea3..2fd392ba 100644 --- a/requirements/index.php +++ b/requirements/index.php @@ -290,5 +290,3 @@ function getPradoVersion() } return ''; } - -?> \ No newline at end of file -- cgit v1.2.3 From 1144e49b8e00fa75b1593e4637c9218d7d944b97 Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Sun, 12 Jan 2014 21:33:46 +0100 Subject: Big quickstart doc overhaul, pt. 1 --- demos/quickstart/protected/controls/TopicList.tpl | 4 +- .../protected/pages/Configurations/Templates1.page | 2 +- .../quickstart/protected/pages/Controls/Data.page | 6 + .../protected/pages/Controls/Standard.page | 4 +- .../protected/pages/Fundamentals/Applications.page | 4 + .../protected/pages/Fundamentals/Architecture.page | 25 +- .../protected/pages/Fundamentals/Components.page | 360 --------------------- .../protected/pages/Fundamentals/Components1.page | 157 +++++++++ .../protected/pages/Fundamentals/Components2.page | 207 ++++++++++++ .../protected/pages/Fundamentals/Pages.page | 14 +- .../protected/pages/Fundamentals/Services.page | 5 +- .../protected/pages/GettingStarted/AboutPrado.page | 10 +- .../pages/GettingStarted/Installation.page | 41 ++- .../protected/pages/Tutorial/AddressBook.page | 9 - 14 files changed, 464 insertions(+), 384 deletions(-) delete mode 100755 demos/quickstart/protected/pages/Fundamentals/Components.page create mode 100755 demos/quickstart/protected/pages/Fundamentals/Components1.page create mode 100644 demos/quickstart/protected/pages/Fundamentals/Components2.page delete mode 100755 demos/quickstart/protected/pages/Tutorial/AddressBook.page (limited to 'demos/quickstart/protected/pages/Tutorial') diff --git a/demos/quickstart/protected/controls/TopicList.tpl b/demos/quickstart/protected/controls/TopicList.tpl index adcdff4a..586b7f75 100755 --- a/demos/quickstart/protected/controls/TopicList.tpl +++ b/demos/quickstart/protected/controls/TopicList.tpl @@ -17,7 +17,6 @@
  • Creating First PRADO Application
  • Sample: Hangman Game
  • Currency Converter
  • -
  • Address Book
  • AJAX Chat Client
  • Command Line Tool
  • @@ -27,7 +26,8 @@
    Fundamentals
    • Architecture
    • -
    • Components
    • +
    • Components: Part I
    • +
    • Components: Part II
    • Controls
    • Pages
    • Modules
    • diff --git a/demos/quickstart/protected/pages/Configurations/Templates1.page b/demos/quickstart/protected/pages/Configurations/Templates1.page index 22b693a6..6c2870f2 100755 --- a/demos/quickstart/protected/pages/Configurations/Templates1.page +++ b/demos/quickstart/protected/pages/Configurations/Templates1.page @@ -3,7 +3,7 @@

      Templates are used to specify the presentational layout of controls. A template can contain static text, components, or controls that contribute to the ultimate presentation of the associated control. By default, an instance of TTemplateControl or its subclass may automatically load and instantiate a template from a file whose name is the same as the control class name. For page templates, the file name suffix must be .page; for other regular template controls, the suffix is .tpl.

      -

      The template format is like HTML, with a few PRADO-specifc tags, including component tags, template control tags, comment tags, dynamic content tags, and dynamic property tags. . +

      The template format is like HTML, with a few PRADO-specifc tags, including component tags, template control tags, comment tags, dynamic content tags, and dynamic property tags.

      diff --git a/demos/quickstart/protected/pages/Controls/Data.page b/demos/quickstart/protected/pages/Controls/Data.page index 3843b332..829a4ef5 100755 --- a/demos/quickstart/protected/pages/Controls/Data.page +++ b/demos/quickstart/protected/pages/Controls/Data.page @@ -2,6 +2,12 @@

      Data Controls

      +

      +Data controls are used to display a repeated content like a list or a table. The content is generated from a collection of items containing the data, called the DataSource, and a template describing the appearance, called Renderer. +
      +The process of assigning a DataSource to a Data control and render the template for each item is called data binding. +

      +
      • TDataList is used to display or modify a list of data items. diff --git a/demos/quickstart/protected/pages/Controls/Standard.page b/demos/quickstart/protected/pages/Controls/Standard.page index 463f90a5..bac51351 100755 --- a/demos/quickstart/protected/pages/Controls/Standard.page +++ b/demos/quickstart/protected/pages/Controls/Standard.page @@ -1,7 +1,9 @@

        Standard Controls

        -

        * the tutorial for this control is not completed yet.

        +

        + Standard controls are the most basic controls in PRADO. They can represent a simple html tag like an <input> or even more comple controls like a date picker or a WYSIWYG text area. Standard controls are in the System.Web.UI.WebControls namespace. +

        • TAccordion displays an accordion consisting of multiple views. At any time, only one view is visible. diff --git a/demos/quickstart/protected/pages/Fundamentals/Applications.page b/demos/quickstart/protected/pages/Fundamentals/Applications.page index 8e0b9e9a..71901170 100755 --- a/demos/quickstart/protected/pages/Fundamentals/Applications.page +++ b/demos/quickstart/protected/pages/Fundamentals/Applications.page @@ -7,7 +7,11 @@ An application is an instance of TApplication or its derived class. It

          Applications are configured via application configurations. They are usually created in entry scripts like the following, +// load the prado entry script require_once('/path/to/prado.php'); +// or, if using composer: +require_once('vendor/autoload.php'); + $application = new TApplication; $application->run(); diff --git a/demos/quickstart/protected/pages/Fundamentals/Architecture.page b/demos/quickstart/protected/pages/Fundamentals/Architecture.page index 10f16c3f..c6bee7de 100755 --- a/demos/quickstart/protected/pages/Fundamentals/Architecture.page +++ b/demos/quickstart/protected/pages/Fundamentals/Architecture.page @@ -2,12 +2,31 @@

          Architecture

          -PRADO is primarily a presentational framework, although it is not limited to be so. The framework focuses on making Web programming, which deals most of the time with user interactions, to be component-based and event-driven so that developers can be more productive. The following class tree depicts some of the major classes provided by PRADO, +PRADO is primarily a presentational framework, although it is not limited to be so. The framework focuses on making Web programming, which deals most of the time with user interactions, to be component-based and event-driven so that developers can be more productive. The following class tree depicts some of the major classes provided by PRADO:

          -When a PRADO application is processing a page request, its static object diagram can be shown as follows, +When a PRADO application is processing a page request, its static object diagram can be shown as follows:

          - + +

          +Once the main Application object gets created, it load the application configuration. +The minimal configuration defines a set of basic modules to parse the Request, create a proper Response, mantain the user Session, handle any Error and publish the needed Assets (images, css, javascript, etc). These helpers module will be available from anywhere inside the application code. +
          +Additionally, any 3rd-party or custom module can be loaded, and external Parameters can be loaded from external configurations. +

          + +

          +Once the basic infrastructure has been set up, the Request module parses the request trying to identify the requested route. Different routes can be handled by different services, but the default route for http requests is the Page Service. +
          +The Page Service's role is to instanciate the requested Page, run it, apply any defined Theme and grab the result in order to build the Response. +

          + +

          +A Page can be a simple script (.php), a Template (.page), or both. PRADO uses a very powerful template engine where Controls can be instanciated directly. +
          +A Control is an self-contained widget that fullfills a specific task; they can be a simple script (.php), a Template (.page), or both. +

          + \ No newline at end of file diff --git a/demos/quickstart/protected/pages/Fundamentals/Components.page b/demos/quickstart/protected/pages/Fundamentals/Components.page deleted file mode 100755 index 11235b56..00000000 --- a/demos/quickstart/protected/pages/Fundamentals/Components.page +++ /dev/null @@ -1,360 +0,0 @@ - -

          Components

          -

          -A component is an instance of TComponent or its child class. The base class TComponent implements the mechanism of component properties and events. -

          - -

          Component Properties

          -

          -A component property can be viewed as a public variable describing a specific aspect of the component, such as the background color, the font size, etc. A property is defined by the existence of a getter and/or a setter method in the component class. For example, in TControl, we define its ID property using the following getter and setter methods, - -class TControl extends TComponent { - public function getID() { - ... - } - public function setID($value) { - ... - } -} - -

          -

          -To get or set the ID property, do as follows, just like working with a variable, - -$id = $component->ID; -$component->ID = $id; - -This is equivalent to the following, - -$id = $component->getID(); -$component->setID( $id ); - -

          -

          -A property is read-only if it has a getter method but no setter method. Since PHP method names are case-insensitive, property names are also case-insensitive. A component class inherits all its ancestor classes' properties. -

          - -

          Subproperties

          -

          -A subproperty is a property of some object-typed property. For example, TWebControl has a Font property which is of TFont type. Then the Name property of Font is referred to as a subproperty (with respect to TWebControl). -

          -

          -To get or set the Name subproperty, use the following method, - -$name = $component->getSubProperty('Font.Name'); -$component->setSubProperty('Font.Name', $name); - -This is equivalent to the following, - -$name = $component->getFont()->getName(); -$component->getFont()->setName( $name ); - -

          - -

          Js-friendly properties

          -

          -A JavaScript-friendly property is a property that can accept both simple strings and raw javascript. -Prado automatically encodes all properties sent clientside inside javascript blocks to avoid security problems (like injections or cross site scripting). -If a property is known to always contain only safe javascript code and its value needs to bypass this encoding, that property can be defined in a special way that will make Prado mark its value as "safe". -Js-friendly properties are identified by their name starting with 'js' (case insensitive): - -// getter, defines a readable property 'Text' -function getJsText() { … } -// setter, defines a writable property 'Text', with $value being the value to be set to the property -function setJsText(TJavaScriptLiteral $value) { … } - -Js-friendly properties can be accessed using both their Js-less name and their Js-enabled name: - -// set some simple text as property value -$component->Text = 'text'; -// set some javascript code as property value -$component->JsText = 'raw javascript'; - -In the first case, the property value will automatically gets encoded when sent clientside inside a javascript block. -In the second case, the property will be 'marked' as being a safe javascript statement and will not be encoded when rendered inside a javascript block. -This special handling makes use of the TJavaScriptLiteral class. -

          - - -

          Component Events

          -

          -Component events are special properties that take method names as their values. Attaching (setting) a method to an event will hook up the method to the places at which the event is raised. Therefore, the behavior of a component can be modified in a way that may not be foreseen during the development of the component. -

          -

          -A component event is defined by the existence of a method whose name starts with the word on. The event name is the method name and is thus case-insensitve. For example, in TButton, we have - -class TButton extends TWebControl { - public function onClick( $param ) { - ... - } -} - -This defines an event named OnClick, and a handler can be attached to the event using one of the following ways, - -$button->OnClick = $callback; -$button->OnClick->add( $callback ); -$button->OnClick[] = $callback; -$button->attachEventHandler( 'OnClick' , $callback ); - -

          - The variable $callback contains the definition of the event handler that can be either a string referring to a global function name, or an array whose first element refers to an object and second element a method name/path that is reachable by the object, e.g. -

          -
            -
          • 'buttonClicked' : buttonClicked($sender,$param);
          • -
          • array($object,'buttonClicked') : $object->buttonClicked($sender,$param);
          • -
          • array($object,'MainContent.SubmitButton.buttonClicked') : $object->MainContent->SubmitButton->buttonClicked($sender,$param);
          • -
          - -

          Global events

          -

          -With the addition of behaviors, a more expansive event model is needed. There -are two new event types (global and dynamic events) as well as a more comprehensive -behavior model that includes class wide behaviors. -

          -

          -A global event is defined by all events whose name starts with 'fx'. -The event name is potentially a method name and is thus case-insensitive. All 'fx' events -are valid as the whole 'fx' event/method space is global in nature. Any object may patch into -any global event by defining that event as a method. Global events have priorities -just like 'on' events; so as to be able to order the event execution. Due to the -nature of all events which start with 'fx' being valid, in effect, every object -has every 'fx' global event. It is simply an issue of tapping into the desired -global event. -

          -

          -A global event that starts with 'fx' can be called even if the object does not -implement the method of the global event. A call to a non-existing 'fx' method -will, at minimal, function and return null. If a method argument list has a first -parameter, it will be returned instead of null. This allows filtering and chaining. -'fx' methods do not automatically install and uninstall. To install and uninstall an -object's global event listeners, call the object's listen and -unlisten methods, respectively. An object may auto-install its global event -during __construct by overriding getAutoGlobalListen and returning true. -

          -

          -As of PHP version 5.3, nulled objects without code references will still continue to persist -in the global event queue because __destruct is not automatically called. In the common -__destruct method, if an object is listening to global events, then unlisten is called. -unlisten is required to be manually called before an object is -left without references if it is currently listening to any global events. This includes -class wide behaviors. -

          -

          -An object that contains a method that starts with 'fx' will have those functions -automatically receive those events of the same name after listen is called on the object. -

          -

          -An object may listen to a global event without defining an 'fx' method of the same name by -adding an object method to the global event list. For example -

          - -$component->fxGlobalCheck=$callback; // or $component->OnClick->add($callback); -$component->attachEventHandler('fxGlobalCheck',array($object, 'someMethod')); - -

          Events between Objects and their behaviors, Dynamic Events

          -

          -An intra-object/behavior event is defined by methods that start with 'dy'. Just as with -'fx' global events, every object has every dynamic event. Any call to a method that -starts with 'dy' will be handled, regardless of whether it is implemented. These -events are for communicating with attached behaviors. -

          -

          -Dynamic events can be used in a variety of ways. They can be used to tell behaviors -when a non-behavior method is called. Dynamic events could be used as data filters. -They could also be used to specify when a piece of code is to be run, eg. should the -loop process be performed on a particular piece of data. In this way, some control -is handed to the behaviors over the process and/or data. -

          -

          -If there are no handlers for an 'fx' or 'dy' event, it will return the first -parameter of the argument list. If there are no arguments, these events -will return null. If there are handlers an 'fx' method will be called directly -within the object. Global 'fx' events are triggered by calling raiseEvent. -For dynamic events where there are behaviors that respond to the dynamic events, a -TCallChain is developed. A call chain allows the behavior dynamic event -implementations to call further implementing behaviors within a chain. -

          -

          -If an object implements IDynamicMethods, all global and object dynamic -events will be sent to __dycall. In the case of global events, all -global events will trigger this method. In the case of behaviors, all undefined -dynamic events which are called will be passed through to this method. -

          -

          -

          Behaviors

          -

          -There are two types of behaviors. There are individual object behaviors and -there are class wide behaviors. Class behaviors depend upon object behaviors. -

          -

          -When a new class implements IBehavior or IClassBehavior or -extends TBehavior or TClassBehavior, it may be added to an -object by calling the object's attachBehavior. The behaviors associated -name can then be used to enableBehavior or disableBehavior -the specific behavior. -

          -

          -All behaviors may be turned on and off via enableBehaviors and -disableBehaviors, respectively. To check if behaviors are on or off -a call to getBehaviorsEnabled will provide the variable. -

          -

          -Attaching and detaching whole sets of behaviors is done using -attachBehaviors and detachBehaviors. clearBehaviors -removes all of an object's behaviors. -

          -

          -asa returns a behavior of a specific name. isa is the -behavior inclusive function that acts as the PHP operator instanceof. -A behavior could provide the functionality of a specific class thus causing -the host object to act similarly to a completely different class. A behavior -would then implement IInstanceCheck to provide the identity of the -different class. -

          -

          -Class behaviors are similar to object behaviors except that the class behavior -is the implementation for all instances of the class. A class behavior -will have the object upon which is being called be prepended to the parameter -list. This way the object is known across the class behavior implementation. -

          -

          -Class behaviors are attached using attachClassBehavior and detached -using detachClassBehavior. Class behaviors are important in that -they will be applied to all new instances of a particular class. In this way -class behaviors become default behaviors to a new instances of a class in -__construct. Detaching a class behavior will remove the behavior -from the default set of behaviors created for an object when the object -is instanced. -

          -

          -Class behaviors are also added to all existing instances via the global 'fx' -event mechanism. When a new class behavior is added, the event -fxAttachClassBehavior is raised and all existing instances that are -listening to this global event (primarily after listen is called) -will have this new behavior attached. A similar process is used when -detaching class behaviors. Any objects listening to the global 'fx' event -fxDetachClassBehavior will have a class behavior removed. -

          -

          Dynamic Intra-Object Events

          -

          -Dynamic events start with 'dy'. This mechanism is used to allow objects -to communicate with their behaviors directly. The entire 'dy' event space -is valid. All attached, enabled behaviors that implement a dynamic event -are called when the host object calls the dynamic event. If there is no -implementation or behaviors, this returns null when no parameters are -supplied and will return the first parameter when there is at least one -parameter in the dynamic event. -

          - - null == $this->dyBehaviorEvent(); - 5 == $this->dyBehaviorEvent(5); //when no behaviors implement this dynamic event - -

          -Dynamic events can be chained together within behaviors to allow for data -filtering. Dynamic events are implemented within behaviors by defining the -event as a method. -

          - -class TObjectBehavior extends TBehavior { - public function dyBehaviorEvent($param1, $callchain) { - //Do something, eg: $param1 += 13; - return $callchain->dyBehaviorEvent($param1); - } -} - -

          -This implementation of a behavior and dynamic event will flow through to the -next behavior implementing the dynamic event. The first parameter is always -return when it is supplied. Otherwise a dynamic event returns null. -

          -

          -In the case of a class behavior, the object is also prepended to the dynamic -event. -

          - -class TObjectClassBehavior extends TClassBehavior { - public function dyBehaviorEvent($hostobject, $param1, $callchain) { - //Do something, eg: $param1 += $hostobject->getNumber(); - return $callchain->dyBehaviorEvent($param1); - } -} - -

          -

          -When calling a dynamic event, only the parameters are passed. The host object -and the call chain are built into the framework. -

          - -

          Global Event and Dynamic event catching

          - -

          -Given that all global 'fx' events and dynamic 'dy' events are valid and -operational, there is a mechanism for catching events called that are not -implemented (similar to the built-in PHP method __call). When -a dynamic or global event is called but a behavior does not implement it, -yet desires to know when an undefined dynamic event is run, the behavior -implements the interface IDynamicMethods and method __dycall. -

          -

          -In the case of dynamic events, __dycall is supplied with the method -name and its parameters. When a global event is raised, via raiseEvent, -the method is the event name and the parameters are supplied. -

          -

          -When implemented, this catch-all mechanism is called for event global event event -when implemented outside of a behavior. Within a behavior, it will also be called -when the object to which the behavior is attached calls any unimplemented dynamic -event. This is the fall-back mechanism for informing a class and/or behavior -of when an global and/or undefined dynamic event is executed. -

          - -

          Namespaces

          -

          -A namespace refers to a logical grouping of some class names so that they can be differentiated from other class names even if their names are the same. Since PHP does not support namespace intrinsically, you cannot create instances of two classes who have the same name but with different definitions. To differentiate from user defined classes, all PRADO classes are prefixed with a letter 'T' (meaning 'Type'). Users are advised not to name their classes like this. Instead, they may prefix their class names with any other letter(s). -

          -

          -A namespace in PRADO is considered as a directory containing one or several class files. A class may be specified without ambiguity using such a namespace followed by the class name. Each namespace in PRADO is specified in the following format, -

          -PathAlias.Dir1.Dir2 -
          -where PathAlias is an alias of some directory, while Dir1 and Dir2 are subdirectories under that directory. A class named MyClass defined under Dir2 may now be fully qualified as PathAlias.Dir1.Dir2.MyClass. -

          -

          -To use a namespace in code, do as follows, - -Prado::using('PathAlias.Dir1.Dir2.*'); - -which appends the directory referred to by PathAlias.Dir1.Dir2 into PHP include path so that classes defined under that directory may be instantiated without the namespace prefix. You may also include an individual class definition by - -Prado::using('PathAlias.Dir1.Dir2.MyClass'); - -which will include the class file if MyClass is not defined. -

          -

          -For more details about defining path aliases, see application configuration section. -

          - -

          Component Instantiation

          -

          -Component instantiation means creating instances of component classes. There are two types of component instantation: static instantiation and dynamic instantiation. The created components are called static components and dynamic components, respectively. -

          - -

          Dynamic Component Instantiation

          -

          -Dynamic component instantiation means creating component instances in PHP code. It is the same as the commonly referred object creation in PHP. A component can be dynamically created using one of the following two methods in PHP, - -$component = new ComponentClassName; -$component = Prado::createComponent('ComponentType'); - -where ComponentType refers to a class name or a type name in namespace format (e.g. System.Web.UI.TControl). The second approach is introduced to compensate for the lack of namespace support in PHP. -

          - -

          Static Component Instantiation

          -

          -Static component instantiation is about creating components via configurations. The actual creation work is done by the PRADO framework. For example, in an application configuration, one can configure a module to be loaded when the application runs. The module is thus a static component created by the framework. Static component instantiation is more commonly used in templates. Every component tag in a template specifies a component that will be automatically created by the framework when the template is loaded. For example, in a page template, the following tag will lead to the creation of a TButton component on the page, - -<com:TButton Text="Register" /> - -

          - -
          diff --git a/demos/quickstart/protected/pages/Fundamentals/Components1.page b/demos/quickstart/protected/pages/Fundamentals/Components1.page new file mode 100755 index 00000000..a610045d --- /dev/null +++ b/demos/quickstart/protected/pages/Fundamentals/Components1.page @@ -0,0 +1,157 @@ + +

          Components: Part I

          +

          +A component is an instance of TComponent or its child class. The base class TComponent implements the mechanism of component properties and events. +

          + +

          Component Properties

          +

          +A component property can be viewed as a public variable describing a specific aspect of the component, such as the background color, the font size, etc. A property is defined by the existence of a getter and/or a setter method in the component class. For example, in TControl, we define its ID property using the following getter and setter methods, + +class TControl extends TComponent { + public function getID() { + ... + } + public function setID($value) { + ... + } +} + +

          +

          +To get or set the ID property, do as follows, just like working with a variable, + +$id = $component->ID; +$component->ID = $id; + +This is equivalent to the following, + +$id = $component->getID(); +$component->setID( $id ); + +

          +

          +A property is read-only if it has a getter method but no setter method. Since PHP method names are case-insensitive, property names are also case-insensitive. A component class inherits all its ancestor classes' properties. +

          + +

          Subproperties

          +

          +A subproperty is a property of some object-typed property. For example, TWebControl has a Font property which is of TFont type. Then the Name property of Font is referred to as a subproperty (with respect to TWebControl). +

          +

          +To get or set the Name subproperty, use the following method, + +$name = $component->getSubProperty('Font.Name'); +$component->setSubProperty('Font.Name', $name); + +This is equivalent to the following, + +$name = $component->getFont()->getName(); +$component->getFont()->setName( $name ); + +

          + +

          Js-friendly properties

          +

          +A JavaScript-friendly property is a property that can accept both simple strings and raw javascript. +Prado automatically encodes all properties sent clientside inside javascript blocks to avoid security problems (like injections or cross site scripting). +If a property is known to always contain only safe javascript code and its value needs to bypass this encoding, that property can be defined in a special way that will make Prado mark its value as "safe". +Js-friendly properties are identified by their name starting with 'js' (case insensitive): + +// getter, defines a readable property 'Text' +function getJsText() { … } +// setter, defines a writable property 'Text', with $value being the value to be set to the property +function setJsText(TJavaScriptLiteral $value) { … } + +Js-friendly properties can be accessed using both their Js-less name and their Js-enabled name: + +// set some simple text as property value +$component->Text = 'text'; +// set some javascript code as property value +$component->JsText = 'raw javascript'; + +In the first case, the property value will automatically gets encoded when sent clientside inside a javascript block. +In the second case, the property will be 'marked' as being a safe javascript statement and will not be encoded when rendered inside a javascript block. +This special handling makes use of the TJavaScriptLiteral class. +

          + + +

          Component Events

          +

          +Component events are special properties that take method names as their values. Attaching (setting) a method to an event will hook up the method to the places at which the event is raised. Therefore, the behavior of a component can be modified in a way that may not be foreseen during the development of the component. +

          +

          +A component event is defined by the existence of a method whose name starts with the word on. The event name is the method name and is thus case-insensitve. For example, in TButton, we have + +class TButton extends TWebControl { + public function onClick( $param ) { + ... + } +} + +This defines an event named OnClick, and a handler can be attached to the event using one of the following ways, + +$button->OnClick = $callback; +$button->OnClick->add( $callback ); +$button->OnClick[] = $callback; +$button->attachEventHandler( 'OnClick' , $callback ); + +

          + The variable $callback contains the definition of the event handler that can be either a string referring to a global function name, or an array whose first element refers to an object and second element a method name/path that is reachable by the object, e.g. +

          +
            +
          • 'buttonClicked' : buttonClicked($sender,$param);
          • +
          • array($object,'buttonClicked') : $object->buttonClicked($sender,$param);
          • +
          • array($object,'MainContent.SubmitButton.buttonClicked') : $object->MainContent->SubmitButton->buttonClicked($sender,$param);
          • +
          + +

          Namespaces

          +

          +A namespace refers to a logical grouping of some class names so that they can be differentiated from other class names even if their names are the same. Since PHP does not support namespace intrinsically, you cannot create instances of two classes who have the same name but with different definitions. To differentiate from user defined classes, all PRADO classes are prefixed with a letter 'T' (meaning 'Type'). Users are advised not to name their classes like this. Instead, they may prefix their class names with any other letter(s). +

          +

          +A namespace in PRADO is considered as a directory containing one or several class files. A class may be specified without ambiguity using such a namespace followed by the class name. Each namespace in PRADO is specified in the following format, +

          +PathAlias.Dir1.Dir2 +
          +where PathAlias is an alias of some directory, while Dir1 and Dir2 are subdirectories under that directory. A class named MyClass defined under Dir2 may now be fully qualified as PathAlias.Dir1.Dir2.MyClass. +

          +

          +To use a namespace in code, do as follows, + +Prado::using('PathAlias.Dir1.Dir2.*'); + +which appends the directory referred to by PathAlias.Dir1.Dir2 into PHP include path so that classes defined under that directory may be instantiated without the namespace prefix. You may also include an individual class definition by + +Prado::using('PathAlias.Dir1.Dir2.MyClass'); + +which will include the class file if MyClass is not defined. +

          +

          +For more details about defining path aliases, see application configuration section. +

          + +

          Component Instantiation

          +

          +Component instantiation means creating instances of component classes. There are two types of component instantation: static instantiation and dynamic instantiation. The created components are called static components and dynamic components, respectively. +

          + +

          Dynamic Component Instantiation

          +

          +Dynamic component instantiation means creating component instances in PHP code. It is the same as the commonly referred object creation in PHP. A component can be dynamically created using one of the following two methods in PHP, + +$component = new ComponentClassName; +$component = Prado::createComponent('ComponentType'); + +where ComponentType refers to a class name or a type name in namespace format (e.g. System.Web.UI.TControl). The second approach is introduced to compensate for the lack of namespace support in PHP. +

          + +

          Static Component Instantiation

          +

          +Static component instantiation is about creating components via configurations. The actual creation work is done by the PRADO framework. For example, in an application configuration, one can configure a module to be loaded when the application runs. The module is thus a static component created by the framework. Static component instantiation is more commonly used in templates. Every component tag in a template specifies a component that will be automatically created by the framework when the template is loaded. For example, in a page template, the following tag will lead to the creation of a TButton component on the page, + +<com:TButton Text="Register" /> + +

          + +
          diff --git a/demos/quickstart/protected/pages/Fundamentals/Components2.page b/demos/quickstart/protected/pages/Fundamentals/Components2.page new file mode 100644 index 00000000..7fc3e010 --- /dev/null +++ b/demos/quickstart/protected/pages/Fundamentals/Components2.page @@ -0,0 +1,207 @@ + +

          Components: Part II

          + +

          Global events

          +

          +With the addition of behaviors, a more expansive event model is needed. There +are two new event types (global and dynamic events) as well as a more comprehensive +behavior model that includes class wide behaviors. +

          +

          +A global event is defined by all events whose name starts with 'fx'. +The event name is potentially a method name and is thus case-insensitive. All 'fx' events +are valid as the whole 'fx' event/method space is global in nature. Any object may patch into +any global event by defining that event as a method. Global events have priorities +just like 'on' events; so as to be able to order the event execution. Due to the +nature of all events which start with 'fx' being valid, in effect, every object +has every 'fx' global event. It is simply an issue of tapping into the desired +global event. +

          +

          +A global event that starts with 'fx' can be called even if the object does not +implement the method of the global event. A call to a non-existing 'fx' method +will, at minimal, function and return null. If a method argument list has a first +parameter, it will be returned instead of null. This allows filtering and chaining. +'fx' methods do not automatically install and uninstall. To install and uninstall an +object's global event listeners, call the object's listen and +unlisten methods, respectively. An object may auto-install its global event +during __construct by overriding getAutoGlobalListen and returning true. +

          +

          +As of PHP version 5.3, nulled objects without code references will still continue to persist +in the global event queue because __destruct is not automatically called. In the common +__destruct method, if an object is listening to global events, then unlisten is called. +unlisten is required to be manually called before an object is +left without references if it is currently listening to any global events. This includes +class wide behaviors. +

          +

          +An object that contains a method that starts with 'fx' will have those functions +automatically receive those events of the same name after listen is called on the object. +

          +

          +An object may listen to a global event without defining an 'fx' method of the same name by +adding an object method to the global event list. For example +

          + +$component->fxGlobalCheck=$callback; // or $component->OnClick->add($callback); +$component->attachEventHandler('fxGlobalCheck',array($object, 'someMethod')); + +

          Events between Objects and their behaviors, Dynamic Events

          +

          +An intra-object/behavior event is defined by methods that start with 'dy'. Just as with +'fx' global events, every object has every dynamic event. Any call to a method that +starts with 'dy' will be handled, regardless of whether it is implemented. These +events are for communicating with attached behaviors. +

          +

          +Dynamic events can be used in a variety of ways. They can be used to tell behaviors +when a non-behavior method is called. Dynamic events could be used as data filters. +They could also be used to specify when a piece of code is to be run, eg. should the +loop process be performed on a particular piece of data. In this way, some control +is handed to the behaviors over the process and/or data. +

          +

          +If there are no handlers for an 'fx' or 'dy' event, it will return the first +parameter of the argument list. If there are no arguments, these events +will return null. If there are handlers an 'fx' method will be called directly +within the object. Global 'fx' events are triggered by calling raiseEvent. +For dynamic events where there are behaviors that respond to the dynamic events, a +TCallChain is developed. A call chain allows the behavior dynamic event +implementations to call further implementing behaviors within a chain. +

          +

          +If an object implements IDynamicMethods, all global and object dynamic +events will be sent to __dycall. In the case of global events, all +global events will trigger this method. In the case of behaviors, all undefined +dynamic events which are called will be passed through to this method. +

          +

          +

          Behaviors

          +

          +There are two types of behaviors. There are individual object behaviors and +there are class wide behaviors. Class behaviors depend upon object behaviors. +

          +

          +When a new class implements IBehavior or IClassBehavior or +extends TBehavior or TClassBehavior, it may be added to an +object by calling the object's attachBehavior. The behaviors associated +name can then be used to enableBehavior or disableBehavior +the specific behavior. +

          +

          +All behaviors may be turned on and off via enableBehaviors and +disableBehaviors, respectively. To check if behaviors are on or off +a call to getBehaviorsEnabled will provide the variable. +

          +

          +Attaching and detaching whole sets of behaviors is done using +attachBehaviors and detachBehaviors. clearBehaviors +removes all of an object's behaviors. +

          +

          +asa returns a behavior of a specific name. isa is the +behavior inclusive function that acts as the PHP operator instanceof. +A behavior could provide the functionality of a specific class thus causing +the host object to act similarly to a completely different class. A behavior +would then implement IInstanceCheck to provide the identity of the +different class. +

          +

          +Class behaviors are similar to object behaviors except that the class behavior +is the implementation for all instances of the class. A class behavior +will have the object upon which is being called be prepended to the parameter +list. This way the object is known across the class behavior implementation. +

          +

          +Class behaviors are attached using attachClassBehavior and detached +using detachClassBehavior. Class behaviors are important in that +they will be applied to all new instances of a particular class. In this way +class behaviors become default behaviors to a new instances of a class in +__construct. Detaching a class behavior will remove the behavior +from the default set of behaviors created for an object when the object +is instanced. +

          +

          +Class behaviors are also added to all existing instances via the global 'fx' +event mechanism. When a new class behavior is added, the event +fxAttachClassBehavior is raised and all existing instances that are +listening to this global event (primarily after listen is called) +will have this new behavior attached. A similar process is used when +detaching class behaviors. Any objects listening to the global 'fx' event +fxDetachClassBehavior will have a class behavior removed. +

          +

          Dynamic Intra-Object Events

          +

          +Dynamic events start with 'dy'. This mechanism is used to allow objects +to communicate with their behaviors directly. The entire 'dy' event space +is valid. All attached, enabled behaviors that implement a dynamic event +are called when the host object calls the dynamic event. If there is no +implementation or behaviors, this returns null when no parameters are +supplied and will return the first parameter when there is at least one +parameter in the dynamic event. +

          + + null == $this->dyBehaviorEvent(); + 5 == $this->dyBehaviorEvent(5); //when no behaviors implement this dynamic event + +

          +Dynamic events can be chained together within behaviors to allow for data +filtering. Dynamic events are implemented within behaviors by defining the +event as a method. +

          + +class TObjectBehavior extends TBehavior { + public function dyBehaviorEvent($param1, $callchain) { + //Do something, eg: $param1 += 13; + return $callchain->dyBehaviorEvent($param1); + } +} + +

          +This implementation of a behavior and dynamic event will flow through to the +next behavior implementing the dynamic event. The first parameter is always +return when it is supplied. Otherwise a dynamic event returns null. +

          +

          +In the case of a class behavior, the object is also prepended to the dynamic +event. +

          + +class TObjectClassBehavior extends TClassBehavior { + public function dyBehaviorEvent($hostobject, $param1, $callchain) { + //Do something, eg: $param1 += $hostobject->getNumber(); + return $callchain->dyBehaviorEvent($param1); + } +} + +

          +

          +When calling a dynamic event, only the parameters are passed. The host object +and the call chain are built into the framework. +

          + +

          Global Event and Dynamic event catching

          + +

          +Given that all global 'fx' events and dynamic 'dy' events are valid and +operational, there is a mechanism for catching events called that are not +implemented (similar to the built-in PHP method __call). When +a dynamic or global event is called but a behavior does not implement it, +yet desires to know when an undefined dynamic event is run, the behavior +implements the interface IDynamicMethods and method __dycall. +

          +

          +In the case of dynamic events, __dycall is supplied with the method +name and its parameters. When a global event is raised, via raiseEvent, +the method is the event name and the parameters are supplied. +

          +

          +When implemented, this catch-all mechanism is called for event global event event +when implemented outside of a behavior. Within a behavior, it will also be called +when the object to which the behavior is attached calls any unimplemented dynamic +event. This is the fall-back mechanism for informing a class and/or behavior +of when an global and/or undefined dynamic event is executed. +

          + +
          diff --git a/demos/quickstart/protected/pages/Fundamentals/Pages.page b/demos/quickstart/protected/pages/Fundamentals/Pages.page index 19900937..0f3a8d9f 100755 --- a/demos/quickstart/protected/pages/Fundamentals/Pages.page +++ b/demos/quickstart/protected/pages/Fundamentals/Pages.page @@ -5,7 +5,7 @@ Pages are top-most controls that have no parent. The presentation of pages are directly displayed to end-users. Users access pages by sending page service requests.

          -Each page must have a template file. The file name suffix must be .page. The file name (without suffix) is the page name. PRADO will try to locate a page class file under the directory containing the page template file. Such a page class file must have the same file name (suffixed with .php) as the template file. If the class file is not found, the page will take class TPage. +Each page can have a template file. The file name suffix must be .page. The file name (without suffix) is the page name. PRADO will try to locate a page class file under the directory containing the page template file. Such a page class file must have the same file name (suffixed with .php) as the template file. If the class file is not found, the page will take class TPage.

          PostBack

          @@ -14,6 +14,18 @@ A form submission is called postback if the submission is made to the pag

          +

          CallBack

          +

          +A callback is a special form submission that, instead of requiring a full page reload on the browser, gets executed in the background through an ajax call. So, a callback is considered a postback too, but not vice versa. +
          +A callback is handled as a normal postback but, instead of re-rendering the entire page, only the specific changes occured on the page gets sent back to the client and merged with the current browser page. A typical callback response consists of: +

            +
          1. one or more pieces of html code that will replace existing content on the page;
          2. +
          3. the javascript instructions needed to update the page;
          4. +
          5. some specific fields used by prado to mantain the pagestate and add the needed external resources (stylesheets, javascript files, etc..).
          6. +
          +

          +

          Page Lifecycles

          Understanding the page lifecycles is crucial to grasp PRADO programming. Page lifecycles refer to the state transitions of a page when serving this page to end-users. They can be depicted in the following statechart, diff --git a/demos/quickstart/protected/pages/Fundamentals/Services.page b/demos/quickstart/protected/pages/Fundamentals/Services.page index 5e5889df..ee19a159 100755 --- a/demos/quickstart/protected/pages/Fundamentals/Services.page +++ b/demos/quickstart/protected/pages/Fundamentals/Services.page @@ -16,7 +16,7 @@ Developers may implement additional services for their applications. To make a s

          Page Service

          -PRADO implements TPageService to process users' page requests. Pages are stored under a directory specified by the BasePath property of the page service. The property defaults to pages directory under the application base path. You may change this default by configuring the service in the application configuration. +PRADO implements TPageService to process users' page requests. Pages are stored under a directory specified by the BasePath property of the page service. The property defaults to Pages directory under the application base path. You may change this default by configuring the service in the application configuration.

          Pages may be organized into subdirectories under the BasePath. In each directory, there may be a page configuration file named config.xml, which contains configurations effective only when a page under that directory or a sub-directory is requested. For more details, see the page configuration section. @@ -30,5 +30,8 @@ http://hostname/index.php?page=Users.Register where the first example takes advantage of the fact that the page service is the default service and Home is the default page.

          +

          +More advanced url routes, like masking real page names and permitting the use of dynamic parameters can be created using the Url mapping module. +

          diff --git a/demos/quickstart/protected/pages/GettingStarted/AboutPrado.page b/demos/quickstart/protected/pages/GettingStarted/AboutPrado.page index 22437158..1a416a32 100755 --- a/demos/quickstart/protected/pages/GettingStarted/AboutPrado.page +++ b/demos/quickstart/protected/pages/GettingStarted/AboutPrado.page @@ -51,12 +51,12 @@ Most PHP frameworks mainly focuses on separating presentation and logic and prom

          Is PRADO Stable Enough?

          -Yes. PRADO was initially released in August 2004. Many test suites have been written and conducted frequently to ensure its quality. It has been used by thousands of developers and many Web applications have been developed based on it. Bugs and feature requests are managed through TRAC system and we have a great user community and development team to ensure all questions are answered in a timely fashion. +Yes. PRADO was initially released in August 2004. Many test suites have been written and conducted frequently to ensure its quality. It has been used by thousands of developers and many Web applications have been developed based on it. Bugs and feature requests are managed through GitHub and we have a great user community and development team to ensure all questions are answered in a timely fashion.

          History of PRADO

          -The very original inspiration of PRADO came from Apache Tapestry. During the design and implementation, I borrowed many ideas from Borland Delphi and Microsoft ASP.NET. The first version of PRADO came out in June 2004 and was written in PHP 4. Driven by the Zend PHP 5 coding contest, I rewrote PRADO in PHP 5, which proved to be a wise move, thanks to the new object model provided by PHP 5. PRADO won the grand prize in the Zend contest, earning the highest votes from both the public and the judges' panel. +The very original inspiration of PRADO came from Apache Tapestry. During the design and implementation, Qiang Xue borrowed many ideas from Borland Delphi and Microsoft ASP.NET. The first version of PRADO came out in June 2004 and was written in PHP 4. Driven by the Zend PHP 5 coding contest, Qiang rewrote PRADO in PHP 5, which proved to be a wise move, thanks to the new object model provided by PHP 5. PRADO won the grand prize in the Zend contest, earning the highest votes from both the public and the judges' panel.

          In August 2004, PRADO started to be hosted on SourceForge as an open source project. Soon after, the project site xisc.com was announced to public. With the fantastic support of PRADO developer team and PRADO users, PRADO evolved to version 2.0 in mid 2005. In this version, Wei Zhuo contributed to PRADO with the excellent I18N and L10N support. @@ -64,6 +64,12 @@ In August 2004, PRADO started to be hosted on SourceForge as an open source proj

          In May 2005, we decided to completely rewrite the PRADO framework to resolve a few fundamental issues found in version 2.0 and to catch up with some cool features available in Microsoft ASP.NET 2.0. After nearly a year's hard work with over 50,000 lines of new code, version 3.0 was finally made available in April 2006.

          +

          +In October 2008, the original development team released a new framework called Yii. Inheriting most of the PRADO code, Yii left the pages/events concept, focusing on a pure MVC design pattern. Since 2009 a lot of people contributed to PRADO fixing issues, developing new features or backporting them from Yii. +

          +

          +To promote a model of community-driven development, the project repositories were moved first on Google Code and then, in September 2013, on GitHub. +

          Starting from version 3.0, significant efforts are allocated to ensure the quality and stability of PRADO. If we say PRADO v2.x and v1.x are proof-of-concept work, we can say PRADO 3.x has grown up to a project that is suitable for serious business application development.

          diff --git a/demos/quickstart/protected/pages/GettingStarted/Installation.page b/demos/quickstart/protected/pages/GettingStarted/Installation.page index 7919e733..956f53c2 100755 --- a/demos/quickstart/protected/pages/GettingStarted/Installation.page +++ b/demos/quickstart/protected/pages/GettingStarted/Installation.page @@ -5,16 +5,17 @@ If you are viewing this page from your own Web server, you are already done with the installation.

          -The minimum requirement by PRADO is that the Web server support PHP 5.2. PRADO has been tested with Apache Web server on Windows and Linux. Highly possibly it may also run on other platforms with other Web servers, as long as PHP 5.2 is supported. +The minimum requirement by PRADO is that the Web server support PHP 5.3.3. PRADO has been tested with Apache Web server on Windows, MacOSX and various Linux distro. Highly possibly it may also run on other platforms with other Web servers, as long as PHP 5.3.3 is supported.

    -

    -Installation of PRADO mainly involves downloading and unpacking. +PRADO can be installed as a standalone package or using composer

    +
    +

    Standalone package

      -
    1. Go to pradosoft.com to grab the latest version of PRADO.
    2. +
    3. Go to pradosoft.com to grab the latest version of PRADO.
    4. Unpack the PRADO release file to a Web-accessible directory.
    @@ -25,5 +26,37 @@ Your installation of PRADO is done and you can start to play with the demo appli

    If you encounter any problems with the demo applications, please use the PRADO requirement checker script, accessible via http://web-server-address/prado/requirements/index.php, to check first if your server configuration fulfills the conditions required by PRADO.

    + +
    +

    Composer install

    +
      +
    1. If you don't have installed composer already, install it globally: + +$ curl -s http://getcomposer.org/installer | php +$ php composer.phar install + +
    2. +
    3. Create a composer.json file for your project: + +{ + "require": { + "pradosoft/prado": "~3.2" + } +} + +
    4. +
    5. Now run the actual installation: + +$ composer install + +
    6. +
    7. In your project include the autoloader, and you will have access to the library classes: + + +
    8. +
    + diff --git a/demos/quickstart/protected/pages/Tutorial/AddressBook.page b/demos/quickstart/protected/pages/Tutorial/AddressBook.page deleted file mode 100755 index f028a636..00000000 --- a/demos/quickstart/protected/pages/Tutorial/AddressBook.page +++ /dev/null @@ -1,9 +0,0 @@ - -

    A Simple Address Book

    -

    This tutorial introduces the basics of connecting to a database - using ActiveRecord - and using Active Record scaffolds to quickly - build a simple address book. -

    - -
    \ No newline at end of file -- cgit v1.2.3