Re: [PHP-PEAR] HTML_Table.php
[email protected] (Bertrand Mansion) Sat, 10 Mar 2001 17:41:54 +0100
| Newsgroups | php.pear |
|---|---|
| Message-ID | <B6D017E2.1BA1%[email protected]> |
le 9/03/01 23:32, clayton collie =E0 [email protected] a =E9crit=A0: > Bertrand, > i dont know if you're thinking in this direction, but a useful subclass > would be one tha is populated (attributes included) via user space > callbacks. you can then specialize and grab data from multidimensional > arrays and db's, all from the same code. > as an example, we can have callbacks for table, row, and cell, once we > specify the number of columns we want to create. >=20 > An example follows : Clayton, I see what you mean and I will try to think about it this weekend. At a first glance, the idea seems good. In the code, user's callback methods wil= l have to be overridden (subclassed). My objective is not to make a class like table.inc in PHPlib. The goal of PHPlib's class is more to extract data from a DB and format them in a table= . The problem is that, even if it is using PHPlib DB "wrapper", it does not d= o the job with Oracle and others. And it is also limited on its layout features. The class I am trying to make should not extract data on its own but data should be passed to it, coming from the outside. In my opinion, it= s purpose should be more layout oriented. BTW, do you think a method to count rows and columns already created could be useful ? What about a method to alternate row colors ( ex: alternateRowColor ($color1, $color2, $starting_row) ) ? Thank you for your feedback. Bertrand Mansion http://www.tapage.fr