WebComponent Code
PHP class that separates programming from presentation using templates
Brought to you by:
jvillalba
File | Date | Author | Commit |
---|---|---|---|
example | 2007-05-18 | jvillalba | [r10] Small speach corrections. |
README | 2007-05-18 | jvillalba | [r12] Small speach corrections. |
WebComponent.php | 2007-05-18 | jvillalba | [r9] Small speach corrections. |
WebComponent ------------ WebComponent Version 2.0 Copyright (C)2007 Javier A. Villalba <javier[dot]villalba[at]gmail[dot]com>. WebComponent is a simple but flexible and powerfull class written in PHP 4 (version >= 4.3) that outputs a string (mainly HTML code) to be displayed in a browser. It holds a template (given by a plain file or string), and an associated array of variables (which values could be strings or others WebComponent objects). The array keys must match with text marks in the template, and when the "dump" method is invoked, the value of each variable is replaced in every mark. See the example for more details. Under a good design, it solves the "developers vs graphical designers war" problem by leaving each one write their own files: the designer make only HTML files *with no PHP code*, just with some decided mark names that will be replaced by the application; and the developer make only PHP files *with no HTML code*, just handling WebComponent variables. The WebComponent class is a Noasol <http://noasol.com> development. License terms ------------- This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.