Web Hosting Talk







View Full Version : Frameworks...


That Guy
06-26-2007, 01:55 AM
I get the jist of it I think, but what exactly is a framework? I want to make a PHP framework, but I'm not sure where to start (as in what it should have, etc). If anyone could clarify this for me, it'd be greatly appreciated. Thanks!

Jatinder
06-26-2007, 03:52 AM
I am not sure if I got this right. You want to develop a PHP framework! But have no idea what a framework is???

If, however, you are looking for PHP frameworks, here are some good ones:

1. http://codeigniter.com/
2. http://www.cakephp.org/
3. http://framework.zend.com/

mwatkins
06-26-2007, 01:10 PM
Add another PHP framework:

http://www.symfony-project.com/

Might also want to read posts 15 through 20 in this thread:
http://www.webhostingtalk.com/showthread.php?p=4575800#post4575800

mwatkins
06-26-2007, 01:23 PM
I get the jist of it I think, but what exactly is a framework? I want to make a PHP framework, but I'm not sure where to start (as in what it should have, etc). If anyone could clarify this for me, it'd be greatly appreciated. Thanks!

A web framework is... what you make of it. Typically they are collections of routines that make web application development more consistent and thus easier. The major components of most frameworks tend to include:


- a template capability - abstracting at a higher level the presentation of your app so that developers don't litter their HTML with code or their code with HTML; typically also done to enable non-technical users (like web UI designers, as an example) to edit templates without breaking application logic.

- a form and UI 'widget' library - abstracting HTML forms, providing validation methods and such to stop developers from writing from scratch each time validation and form handling code.

- a string IO system, to provide one or more of the following: Unicode handling, i18n Internationalization, XSS (cross site scripting) prevention / automatic quoting / unquoting, and the like.

- a "publishing" or dispatch metaphor, to allow for nice URLS to your pages/classes so that:

http://example.com/item.php?item=1234&options=features

Can become:

http://example.com/inventory/123/features

- various other "helper" utilities

- some sort of database object-relational mapper so that developers can deal with objects (classes) rather than raw SQL.

- security, security, security

Summary

In short, the bottom line is to write once all the various bits that are generic to any web application such that the actual web application developer can focus on business logic and presentation.

Rather than write one, it would be a good idea to use one, or two, and see how they turn your crank and then if you still have the bug to go it alone, start writing one.

That Guy
06-26-2007, 03:44 PM
Wow, that was a pretty good post, mwatkins. Thanks! :D