Thread: [phpWebApp-commits] CVS: documentation/templates/tutorial intro.html,1.1.1.1,1.2 templates.html,1.1.
Brought to you by:
dashohoxha
From: Dashamir H. <das...@us...> - 2003-02-23 14:29:13
|
Update of /cvsroot/phpwebapp/documentation/templates/tutorial In directory sc8-pr-cvs1:/tmp/cvs-serv11335/templates/tutorial Modified Files: intro.html templates.html transitions.html tutorial_items.php Log Message: Index: intro.html =================================================================== RCS file: /cvsroot/phpwebapp/documentation/templates/tutorial/intro.html,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** intro.html 21 Feb 2003 08:18:36 -0000 1.1.1.1 --- intro.html 23 Feb 2003 14:29:07 -0000 1.2 *************** *** 17,115 **** <br> <table width="100%" align="center" cellspacing="0" cellpadding="20" border="0"> ! <tr> ! <td width="50%" valign="top"> ! <b><a href="javascript: tutorialTab('transitions')">1 - Transitions</a></b> ! <br> ! A very simple application that has 2 or 3 HTML files ! which have transitions to each-other and have some ! links to external pages. ! Explains the folder structure of a simple application, ! explains what are the transitions and the difference ! between the transitions and the links. Explains how to ! debug transitions. ! </td> ! <td width="50%" valign="top"> ! <b><a href="javascript: tutorialTab('templates')">2 - Templates</a></b> ! <br> ! The HTML files now become templates. This application ! uses the <Include> tag to insert the same header file ! at the beginning of each template and to break the ! templates into sub templates. It shows how to include ! the javascript code and the stylesheet of each template. ! It also explains the use of the framework comments and ! the difference between them and the HTML comments. ! Explains how to debug the template structure. ! </td> ! </tr> ! <tr> ! <td width="50%" valign="top"> ! <b><a href="javascript: tutorialTab('weboxes')">3 - Introducing WebBox-es</a></b> ! <br> ! Some of the templates are turned into weboxes. ! Explains the fundamental difference between a template ! and a webox. The PHP code of the weboxes ! declares the function onRender(), where some variables ! are added using WebApp::addVar(), and these {{variables}} ! are used in the corresponding template. ! </td> ! <td width="50%" valign="top"> ! <b><a href="javascript: tutorialTab('events')">4 - Sending and Handelling Events</a></b> ! <br> ! Some of the transitions send ! events to some of the weboxes. The target weboxes handle ! these events in their eventHandler() functions. Explains also ! the transitions to 'thisPage', sending an event to 'any' webox, ! and sending events to 'none' of the weboxes (independent events). ! </td> ! </tr> ! <tr> ! <td width="50%" valign="top"> ! <b><a href="javascript: tutorialTab('sess_var')">5 - Session and Variables</a></b> ! <br> ! Explains what are the session variables and how to use them. ! Explains further how the {{template variables}} are evaluated. ! Explains how the session variables are used to keep the state ! of the weboxes and the states of the application (introduces ! the function onLoad() of the weboxes). Explains how the <If> ! elements are used to display templates conditionally. ! Explains how to debug the session variables. ! </td> ! <td width="50%" valign="top"> ! <b><a href="javascript: tutorialTab('database')">6 - Interacting with a Database</a></b> ! <br> ! Explains how to set a default connection with a database. ! Explains the configuration file of a template (*.tpc) and ! the <Recordset> element. Explains the <Repeat> elements and ! how to use them inside a template. Explains the '.db' file ! of a webox, the <Recordset> and <dbCommand> elements inside it, ! and how to use the functions WebApp::execDBCmd(), WebApp::openRS() ! and WebApp::execQuery() inside the PHP code of the webox. ! Explains how to debug the recordsets of the page and the execution ! times of the queries (and other processes). ! </td> ! </tr> ! <tr> ! <td width="50%" valign="top"> ! <b><a href="javascript: tutorialTab('advanced')">7 - All the rest of the advanced features</a></b> ! <br> ! A complicated, real and almost finished web application (which ! may evolve from the previous samples or may be independent of ! them), which makes use and explains almost all of the advanced ! features of framework which have not been explained in the ! previous samples. Such features may be: ! <ul> ! <li> Detailed explanation of the <Repeat> element and the page ! recordsets. ! <li> <Var> elements ! <li> An <Include> element that uses a variable. ! <li> Usage of an external webox. ! <li> Etc. ! </ul> ! </td> ! <td width="50%" valign="top"> ! <b>8 - _____</b> ! <br> ! </td> ! </tr> </table> --- 17,118 ---- <br> <table width="100%" align="center" cellspacing="0" cellpadding="20" border="0"> ! <tr> ! <td width="50%" valign="top"> ! <b><a href="javascript: tutorialTab('transitions')">1 - Transitions</a></b> ! <br> ! A very simple application that has 2 or 3 HTML files ! which have transitions to each-other and have some ! links to external pages. ! Explains the folder structure of a simple application, ! explains what are the transitions and the difference ! between the transitions and the links. Explains how to ! debug transitions. ! </td> ! <td width="50%" valign="top"> ! <b><a href="javascript: tutorialTab('templates')">2 - Templates</a></b> ! <br> ! The HTML files now become templates. This application ! uses the <Include> tag to insert the same header file ! at the beginning of each template and to break the ! templates into sub templates. It shows how to include ! the javascript code and the stylesheet of each template. ! It also explains the use of the framework comments and ! the difference between them and the HTML comments. ! Explains how to debug the template structure. ! </td> ! </tr> ! <tr> ! <td width="50%" valign="top"> ! <b><a href="javascript: tutorialTab('weboxes')">3 - Introducing WebBox-es</a></b> ! <br> ! Some of the templates are turned into weboxes. ! Explains the fundamental difference between a template ! and a webox. The PHP code of the weboxes ! declares the function onRender(), where some variables ! are added using WebApp::addVar(), and these {{variables}} ! are used in the corresponding template. ! </td> ! <td width="50%" valign="top"> ! <b><a href="javascript: tutorialTab('events')">4 - Sending and Handelling Events</a></b> ! <br> ! Some of the transitions send ! events to some of the weboxes. The target weboxes handle ! these events in their eventHandler() functions. Explains also ! the transitions to 'thisPage', sending an event to 'any' webox, ! and sending events to 'none' of the weboxes (independent events). ! </td> ! </tr> ! <tr> ! <td width="50%" valign="top"> ! <b><a href="javascript: tutorialTab('sess_var')">5 - Session and Variables</a></b> ! <br> ! Explains what are the session variables and how to use them. ! Explains further how the {{template variables}} are evaluated. ! Explains how the session variables are used to keep the state ! of the weboxes and the states of the application (introduces ! the function onLoad() of the weboxes). Explains how the <If> ! elements are used to display templates conditionally. ! Explains how to debug the session variables. ! </td> ! <td width="50%" valign="top"> ! <b><a href="javascript: tutorialTab('database')">6 - Interacting with a Database</a></b> ! <br> ! Explains how to set a default connection with a database. ! Explains the configuration file of a template (*.tpc) and ! the <Recordset> element. Explains the <Repeat> elements and ! how to use them inside a template. Explains the '.db' file ! of a webox, the <Recordset> and <dbCommand> elements inside it, ! and how to use the functions WebApp::execDBCmd(), WebApp::openRS() ! and WebApp::execQuery() inside the PHP code of the webox. ! Explains how to debug the recordsets of the page and the execution ! times of the queries (and other processes). ! </td> ! </tr> ! <tr> ! <td width="50%" valign="top"> ! <b><a href="javascript: tutorialTab('advanced')">7 - All the rest of the advanced features</a></b> ! <br> ! A complicated, real and almost finished web application (which ! may evolve from the previous samples or may be independent of ! them), which makes use and explains almost all of the advanced ! features of framework which have not been explained in the ! previous samples. Such features may be: ! <ul> ! <li> Detailed explanation of the <Repeat> element and the page ! recordsets. ! <li> <Var> elements ! <li> An <Include> element that uses a variable. ! <li> Usage of an external webox. ! <li> Etc. ! </ul> ! </td> ! <td width="50%" valign="top"> ! <b><a href="javascript: tutorialTab('documentation')">8 - The documentation application</a></b> ! <br> ! This web application (the 'phpWebApp documentation') is built ! using phpWebApp itself. This tutorial explains how this ! web application is constructed. ! </td> ! </tr> </table> Index: templates.html =================================================================== RCS file: /cvsroot/phpwebapp/documentation/templates/tutorial/templates.html,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** templates.html 21 Feb 2003 08:18:36 -0000 1.1.1.1 --- templates.html 23 Feb 2003 14:29:07 -0000 1.2 *************** *** 10,15 **** Explains how to debug the template structure. <br><br> ! [<a href="/app2/" target="_new">Test</a>] ! [<a href="/app2/browse.php" target="_new">Browse</a>] [<a href="http://phpwebapp.sourceforge.net/download/app2.tar.gz">Download</a>] <br><br> --- 10,15 ---- Explains how to debug the template structure. <br><br> ! [<a href="{{APP2_URL}}" target="_blank">Test</a>] ! [<a href="{{APP2_URL}}browse.php" target="_blank">Browse</a>] [<a href="http://phpwebapp.sourceforge.net/download/app2.tar.gz">Download</a>] <br><br> *************** *** 55,69 **** The templates may contain variables inside them (called "template variables"), which are replaced by the framework with their string values. The variables ! inside a template are denoted by double curly braces: <i>{ {tpl_var} }</i>. </p> <p> See this <a href="javascript: codeReview('{{APP2_PATH}}templates/page3/page3.html','4,8,10,12','')">example</a>. ! The <i>{ {TPL_URL} }</i> variable in line 4 contains the URL of the folder ! 'templates', which in this case is '/app2/templates/'. The <i>{ {TPL_PATH} }</i> variable in lines 8 and 12 contains the path in the server of the folder ! templates, e.g. '/var/www/html/app2/templates/'. Both of them are declared in the file <a href="javascript: codeReview('{{APP2_PATH}}config/const.Paths.php','6,7','')"><i>config/const.Paths.php</i></a>. ! The variable <i>{ {./} }</i> in line 10 is a special framework variable that always contains the path of the current folder, i.e. the folder of the current file. --- 55,69 ---- The templates may contain variables inside them (called "template variables"), which are replaced by the framework with their string values. The variables ! inside a template are denoted by double curly braces: <i>{{#tpl_var}}</i>. </p> <p> See this <a href="javascript: codeReview('{{APP2_PATH}}templates/page3/page3.html','4,8,10,12','')">example</a>. ! The <i>{{#TPL_URL}}</i> variable in line 4 contains the URL of the folder ! 'templates', which in this case is '{{APP2_URL}}templates/'. The <i>{{#TPL_PATH}}</i> variable in lines 8 and 12 contains the path in the server of the folder ! templates, e.g. '/var/www/html{{APP2_URL}}templates/'. Both of them are declared in the file <a href="javascript: codeReview('{{APP2_PATH}}config/const.Paths.php','6,7','')"><i>config/const.Paths.php</i></a>. ! The variable <i>{{#./}}</i> in line 10 is a special framework variable that always contains the path of the current folder, i.e. the folder of the current file. *************** *** 159,165 **** <li> All the images of this application are placed in the folder '/img/'. ! In templates they are linked using the { {IMG_URL} } variable. <a href="javascript: codeReview('{{APP2_PATH}}templates/footer.html','9,10','')">See</a> how it is used. ! The { {IMG_URL} } template variable gets the value from the PHP constant IMG_URL, which is declared in the file <a href="javascript: codeReview('{{APP2_PATH}}config/const.Paths.php','6','')"><i>config/const.Paths.php</i></a>. --- 159,165 ---- <li> All the images of this application are placed in the folder '/img/'. ! In templates they are linked using the {{#IMG_URL}} variable. <a href="javascript: codeReview('{{APP2_PATH}}templates/footer.html','9,10','')">See</a> how it is used. ! The {{#IMG_URL}} template variable gets the value from the PHP constant IMG_URL, which is declared in the file <a href="javascript: codeReview('{{APP2_PATH}}config/const.Paths.php','6','')"><i>config/const.Paths.php</i></a>. *************** *** 183,187 **** <br><br> ! <li> <a href="/app2/browse.php" target="_blank">Browse</a> the files of the application and see the templates 'page1.html', 'header.html', 'footer.html', 'page1_content.html'. --- 183,187 ---- <br><br> ! <li> <a href="{{APP2_URL}}browse.php" target="_blank">Browse</a> the files of the application and see the templates 'page1.html', 'header.html', 'footer.html', 'page1_content.html'. *************** *** 262,266 **** If all the images in the application are linked like this: <pre> ! <img src="{ {IMG_URL} }image_name.gif"/> </pre> there will be no problem. However, if any image is hard linked like this: --- 262,266 ---- If all the images in the application are linked like this: <pre> ! <img src="{{#IMG_URL}}image_name.gif"/> </pre> there will be no problem. However, if any image is hard linked like this: *************** *** 283,287 **** <li> Replace the selected lines with this line: <pre> ! <Include SRC="{ {./} }tpl_vars.html"/> </pre> <li> Copy the --- 283,287 ---- <li> Replace the selected lines with this line: <pre> ! <Include SRC="{{#./}}tpl_vars.html"/> </pre> <li> Copy the *************** *** 290,294 **** them with: <pre> ! <Include SRC="{ {./} }include_tag.html"/> </pre> <li> Copy the --- 290,294 ---- them with: <pre> ! <Include SRC="{{#./}}include_tag.html"/> </pre> <li> Copy the *************** *** 297,301 **** them with: <pre> ! <Include SRC="{ {./} }comments.html"/> </pre> <li> Copy the --- 297,301 ---- them with: <pre> ! <Include SRC="{{#./}}comments.html"/> </pre> <li> Copy the *************** *** 304,308 **** them with: <pre> ! <Include SRC="{ {./} }js_code.html"/> </pre> <li> If you test the application now, page1 will be displayed correctly, --- 304,308 ---- them with: <pre> ! <Include SRC="{{#./}}js_code.html"/> </pre> <li> If you test the application now, page1 will be displayed correctly, *************** *** 336,341 **** stylesheet and the header and footer templates. Open the file <a href="javascript: codeReview('{{APP2_PATH}}templates/page1.html','4,8,10','')">page1/page1.html</a> ! and replace <i>{ {./} }</i> with <i>{ {TPL_URL} }</i> for the ! stylesheet, and with <i>{ {TPL_PATH} }</i> for the templates, in the selected lines. </ol> --- 336,341 ---- stylesheet and the header and footer templates. Open the file <a href="javascript: codeReview('{{APP2_PATH}}templates/page1.html','4,8,10','')">page1/page1.html</a> ! and replace <i>{{#./}}</i> with <i>{{#TPL_URL}}</i> for the ! stylesheet, and with <i>{{#TPL_PATH}}</i> for the templates, in the selected lines. </ol> *************** *** 357,361 **** <li> At the top of the file 'page1_content.html' add this line: <pre> ! <link rel="stylesheet" type="text/css" href="{ {./} }page1_content.css"> </pre> <li> Test the application and notice the changes in page1. --- 357,361 ---- <li> At the top of the file 'page1_content.html' add this line: <pre> ! <link rel="stylesheet" type="text/css" href="{{#./}}page1_content.css"> </pre> <li> Test the application and notice the changes in page1. *************** *** 378,382 **** <a href="javascript: codeReview('{{APP2_PATH}}templates/page3/tmpl.html','11','')">tmpl.html</a> and change the SRC of the included template to ! "{ {./} }tpl_2/tpl_2.html". <li> Test the application and go to page3. It should be displayed correctly. </ol> --- 378,382 ---- <a href="javascript: codeReview('{{APP2_PATH}}templates/page3/tmpl.html','11','')">tmpl.html</a> and change the SRC of the included template to ! "{{#./}}tpl_2/tpl_2.html". <li> Test the application and go to page3. It should be displayed correctly. </ol> Index: transitions.html =================================================================== RCS file: /cvsroot/phpwebapp/documentation/templates/tutorial/transitions.html,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** transitions.html 21 Feb 2003 08:18:36 -0000 1.1.1.1 --- transitions.html 23 Feb 2003 14:29:07 -0000 1.2 *************** *** 9,14 **** debug transitions. <br><br> ! [<a href="/app1/" target="_new">Test</a>] ! [<a href="/app1/browse.php" target="_new">Browse</a>] [<a href="http://phpwebapp.sourceforge.net/download/app1.tar.gz">Download</a>] <br><br> --- 9,14 ---- debug transitions. <br><br> ! [<a href="{{APP1_URL}}" target="_blank">Test</a>] ! [<a href="{{APP1_URL}}browse.php" target="_blank">Browse</a>] [<a href="http://phpwebapp.sourceforge.net/download/app1.tar.gz">Download</a>] <br><br> *************** *** 61,65 **** <br> If you have not tested the application yet, please ! <a href="/app1/" target="_new">test it</a> now and pay attention to how the <b>GoTo()</b> is used. </p> --- 61,65 ---- <br> If you have not tested the application yet, please ! <a href="{{APP1_URL}}" target="_blank">test it</a> now and pay attention to how the <b>GoTo()</b> is used. </p> *************** *** 107,111 **** <p> If you have not yet browsed the application, then ! <a href="/app1/browse.php" target="_new">browse it</a> now. </p> <p> --- 107,111 ---- <p> If you have not yet browsed the application, then ! <a href="{{APP1_URL}}browse.php" target="_blank">browse it</a> now. </p> <p> Index: tutorial_items.php =================================================================== RCS file: /cvsroot/phpwebapp/documentation/templates/tutorial/tutorial_items.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** tutorial_items.php 21 Feb 2003 08:18:36 -0000 1.1.1.1 --- tutorial_items.php 23 Feb 2003 14:29:07 -0000 1.2 *************** *** 5,16 **** */ $menu_items = array( ! "intro" => "Introduction", ! "transitions" => "1-Transitions", ! "templates" => "2-Templates", ! "weboxes" => "3-WebBox-es", ! "events" => "4-Events", ! "sess_var" => "5-Session and Variables", ! "database" => "6-Database", ! "advanced" => "7-Advanced" ); ?> --- 5,17 ---- */ $menu_items = array( ! "intro" => "0 - Introduction", ! "transitions" => "1 - Transitions", ! "templates" => "2 - Templates", ! "weboxes" => "3 - WebBox-es", ! "events" => "4 - Events", ! "sess_var" => "5 - Session and Variables", ! "database" => "6 - Database", ! "advanced" => "7 - Advanced", ! "documentation" => "8 - Documentation" ); ?> |