new Php library to divide logic from code: POT Php Object Template

From: Date: Sat, 06 Nov 2004 11:58:07 +0000
Subject: new Php library to divide logic from code: POT Php Object Template
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-26527@lists.php.net to get a copy of this message
Just to inform you that: I recent posted to Sourceforge a new project: http://sourceforge.net/projects/pot/ It is my 2 years efforts to bring to the Php community a decent template system with GPL licence. This is the introduction to the rulebook that try to explain wht it does. Introduction In the last 5 years I developed many sites using Php, and as other people I feel that the lack of something that help to develop in less amount of time. Many people try to develop RAID applications with home-made functions. Everybody try to separate the logic from the code: no one succeded. I started myself doing the same, but after one year of developing I started to learn Java and I discovered the limit of those projects. I altered the initial goal adding a lot of java-like features, removing not clear things, try to uniform commands and make each object really work with the others. Finally after 2 years of development, Pot it is ready to be used. Overview The goal of Pot is to totally divide logic from the design. Pot can be used by ‘common’ people just writing some XML tags in the html code, that will be parsed by the Php Pot code to create the final working page. For ‘working page’ is inteded a page that uses technologies like Cascading Style Sheets, Javascript, animated objects, form data checking. Using your favourite WYSIWYG editor (Dreamweaver, GoLive) you can create html pages where you place an OBJECT’s tag where you need and write the required Pot param/value tags. During run-time Pot will load the page and replace all the tags with the appropriate code. For example if you want a form text just write this code (or use the buttons of your editor) : <object> <param name=”type” value=”text”/> <param name=”do” value=”edit”/> <param name=”sql:field” value=”lastname”/> <param name=”text:size” value=”6”/> </object> During execution Pot replaces this object code with the HTML working code: <input type=”text” name=”lastname” value=”” size=”6”> Ok, this example is not very useful because the Pot source code is a lot bigger than the result Html code. Now imagine if you wish that your text form use the same font you defined in the CSS file; that the user must write something (not just left empty the text box) and that the minimum size of the allowed chars are 4 and the maximum are 30. Doing this task in HTML require a lot of code and programming skills; with Pot you only have to add 4 lines to precedent example: <param name=”css:class” value=”myclassname” /> <param name=”text:length:min” value=”4”/> <param name=”text:length:min:message” value=”You must write minimum 4 chars “/> <param name=”text:length:max” value=”30” /> Bye Spread the word Gerardo Iula (Dino) Milan Italy

« previous php.mirrors (#26527) next »