Re: What about javascript

From: Date: Thu, 09 Aug 2001 14:21:51 +0000
Subject: Re: What about javascript
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-1342@lists.php.net to get a copy of this message
le 9/08/01 15:49, Tomas V.V.Cox à cox@idecnet.com a écrit : > One of my ideas is to connect the row object with the template system to > build a really automatic system, something like: > > while ($res->fetchInto($row)){ > $row->autoBlock('block1'); > } > > This assigns all var's in a block and parses it. Ie: > > <!-- BEGIN: block1 --> > <tr><td>Name: {block1_id}</td></tr> > <!-- END: block1 --> > > "block1_id" will be filled with the id column data from the Database. > Isn't sound cool? This is also easy to do with our Form class. Fields can be editable or frozen depending on their frozen tag ($element->freeze() or $element->unfreeze()). So, they will show in an input field or just as normal text. What is difficult, in order to automate this process, is to map elements to type of fields. Is 'Name' a text or a textarea type of field ? By the way, our class makes use of Html_Common which is very useful and user-friendly. It lets you easily add attributes to elements. > Please be sure that all the validations are done by php besides JS. JS > is very comfortable to the user but is useless as a secure validation > system. Naturally, what do you think !!! :-) Actually, user can choose if he wants javascript or not, but server-side validation is always on, as long as a validation rule is defined. Validation rules definitions are stored in a separate class (Form_validation) which can be overridden by user if he wants to make or add his own validation rules (for validation against database data for example). By the way, we still have to implement an upload kind of field (type=file). I am still thinking about it... I have an extensive look at your upload class, Tomas. Thanks, Bertrand Mansion Mamasam

« previous php.pear.dev (#1342) next »