phpwebapp-discussion Mailing List for phpWebApp
Brought to you by:
dashohoxha
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(4) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
---|
From: SourceForge.net <no...@so...> - 2003-07-31 09:44:21
|
Read and respond to this message at: https://sourceforge.net/forum/message.php?msg_id=2129019 By: dashohoxha The phpWebApp framework takes the templating approach for separating the HTML code from the PHP code, but it does it in a different way from the other templating engines. It also provides a way for taking out of the PHP code the SQL code and queries. This is useful because in real web applications there are usually big queries; putting them in a separate file reduces the complexity of the PHP code (makes it smaller and more easily understandable and modifyable) and also makes the understanding and modification of the queries easier. ______________________________________________________________________ You are receiving this email because you elected to monitor this forum. To stop monitoring this forum, login to SourceForge.net and visit: https://sourceforge.net/forum/unmonitor.php?forum_id=135222 |
From: SourceForge.net <no...@so...> - 2003-07-31 09:27:13
|
Read and respond to this message at: https://sourceforge.net/forum/message.php?msg_id=2129012 By: dashohoxha The HTML syntax offers a possibility to take out the JavaScript code and the CSS code in separate files. It is like this: <script language="javascript" src="file.js"></script> <link rel="stylesheet" href="file.css" type="text/css" /> However there is no standard way to clearly separate the HTML, PHP and SQL codes. You can try to keep the degree of mixing of HTML and PHP code at a minimum level by carefully designing the application. E.g. you can place all the PHP code unrelated to the HTML generation (the code that contains the logic of the application) in a separate file and keep the file that generates the HTML page as lean as possible. E.g.: <?php include "app_logic.php"; $title = ...; . . . . . ?> <html> <head> <title><? echo $title ?></title> </head> <body> . . . . . </body> </html> This does not solve the problem completely, however. First, you still have some PHP code inside the HTML page. Second, the 'HTML' file has the extenssion ".php", which deceives some editors and they colorize it wrongly. A better soluttion to separate the HTML and PHP codes is to use a templating engine. It uses templates for generating the final HTML page. Each template is a pure HTML file, which also has some slots or variables in it. The values of these variables are calculated by the PHP code and they are passed to the engine. Then the engine reads the templates, replaces the variables by their values and thus generates an HTML page which is sent to the browser. ______________________________________________________________________ You are receiving this email because you elected to monitor this forum. To stop monitoring this forum, login to SourceForge.net and visit: https://sourceforge.net/forum/unmonitor.php?forum_id=135222 |
From: SourceForge.net <no...@so...> - 2003-07-31 09:15:52
|
Read and respond to this message at: https://sourceforge.net/forum/message.php?msg_id=2129008 By: dashohoxha Suppose that we have constructed a web application with PHP. If we inspect the code inside one of the files of the application, what we usually see is a jam of HTML code, JavaScript code, CSS code, PHP code, SQL code etc. This kind of mixing many languages inside the same file is a really bad thing, for these reasons: 1 - It makes the editing of the application very difficult. Most of the editors have code colorizing features, automatic indentation features, etc. for many languages, in order to simplify editing and to make it easy. But when they are faced with such a mix of languages, very often they get confused. As a result, such features become useless, and even they become harmful, because they may colorize wrongly or indent wrongly. 2 - It makes the maintenance of the application very difficult. It is very difficult for somebody else to try to read, to understand and to modify such a code, and even for the author of the code himself (after some time has passed). 3 - Makes difficult the team work. Suppose that a web application is constructed by a team that is composed of PHP programmers, who construct the server side logic of the application, web designers (HTML+CSS) who create the look and feel of the application, JavaScript programmers who construct the client side logic of the application, and DB specialists who construct the database and the queries. In this case it is very difficult for any one of them to make modifications in a big file that has lots of unfamiliar code to them, without making any mistake. Take for example the web designer, it is very difficult for him to change the look and layout of a web page that is tightly interwoven with PHP code. 4 - Increases the complexity of web applications. Different from the previous example, suppose now that a web application is constructed by one or more programmers and each of them is responsible for a certain part of the application. In this case each of them has to have good skills in all of them: PHP, HTML, CSS, JavaScript, database, etc. This is difficult to happen and it increases the complexity and the difficulties of constructing a web application. It is clear that such a mix of codes is a bad thing and a bad practice and it must be avoided as much as possible. ______________________________________________________________________ You are receiving this email because you elected to monitor this forum. To stop monitoring this forum, login to SourceForge.net and visit: https://sourceforge.net/forum/unmonitor.php?forum_id=135222 |
From: Dashamir H. <dh...@in...> - 2003-07-30 07:37:32
|
This list is for discussing issues related to web application development= =20 in general. Here we will try to identify the reasons why developing web applications is much more difficult than developing desktop applications.= =20 We will also try to find out different ways how these difficulties can be= =20 solved or overcomed. We will discuss as well how these problems are solve= d=20 by phpWebApp framework and by many other web application frameworks that = exist today, the advantages and dissadvantages of these solutions, how they can= =20 be improved etc. Everybody that is interested in this topic can participate in the discuss= ion, especially the designers and developers of the existing web application frameworks and content management systems, web application developers tha= t=20 are using these frameworks, general web application developers (that are = using plain PHP, Perl, etc.) etc. There is also the forum "Web Application Discussion": https://sourceforge.net/forum/forum.php?forum_id=3D135222 =20 for discussing the same things as this list. Hopefully, I will create a w= iki page later for this topic, where we can condense all the ideas discussed = in this mailing list and in the forum, in the form of a structured document. |