Re: Skeleton Framework
Posted: Fri Mar 27, 2009 4:01 am
The source code still needs some refining, but I'll probably release the framework sometime this summer and I'll post on here when I do. For the forms class, all it really does is build each element for the form in order. If you need to include something else into the form, I use 3 different methods: append($data), startTag($tag, array $attributes), and endTag($tag). The first will add whatever data you give it in the same order, the last two are good if you need to wrap parts of the form.thinsoldier wrote: @VirtuosiMedia
I'd really like to see the source of your form class and database class. How do you customize the html surrounding your classes (tables/divs/fieldsets etc)?
The database class is fairly simple in that it constructs the query by concatenating the different parameters you pass in to the methods. It uses PDO with bound parameters to execute the queries, so theoretically everything is injection safe. The reason I pass in the different parts of the query into various methods is because I eventually want to provide an abstraction layer for different flavors of SQL, the idea being that you write your code once, the details are taken care of by the class, and it works with multiple database types, with the only change being made in a configuration file. The downside is that it limits what types of data manipulation can be done because not all DBMS's support the same features and not everything can be emulated across all types. I haven't had a chance to create classes for anything but MySQL yet, but so far the MySQL class seems to be working fine.