Where can I get off-the-shelf PHP controls?
April 20, 2008 1:04 AM   Subscribe

I'm at beginner at PHP and web programming, but have been programming on the desktop for a while. I want to make a web application, about 2 dozen webpages that read/write to a database, and with user accounts. Where can I get off-the-shelf controls for PHP like a DataGrid, Membership/Authentication, Tabs, and Popup Form/Dialog?

I don't want to build from scratch an entire login system, or a paged datagrid. I'm not opposed to spending about $1000 or so to buy something like ComponentArt Web.UI for PHP. But I can only find free hobbyist controls on scripting websites.

Maybe another option - should I go with ASP.NET instead? I tried out the express edition and tried to play around with it but I was completely lost.
posted by lpctstr; to Computers & Internet (8 answers total) 5 users marked this as a favorite
 
Developing for the web is very different from developing desktop apps. Some of the things you list are primarily server-side, some are client-side, and most PHP developers keep the two aspects mostly separate.

You could probably get reasonably close to the kind of thing you're after by combining a suitable PHP framework with a suitable client-side library (e.g. YUI), but if you want the server- and client-side stuff more closely integrated integrated you should be looking at moving to something like GWT or .NET.

It's important to consider whether you're really developing desktop-like applications or things that are best described as sites; if it's the latter then you need to ensure you don't inflict a load of bloated/invalid/inaccessible user interface elements on users who just want to perform simple tasks.
posted by malevolent at 2:07 AM on April 20, 2008


There isn't much of a market for 'controls' in PHP, so it's not surprising there aren't (m)any sellers. There is a Delphi for PHP produce, but I haven't looked at it myself, and have only heard bad things about it.

There are frameworks out there for PHP that will abstract away a lot of the details, but using something like Zend Framework, Symfony or Code Igniter, you're going to have to get your hands dirty to some extent - they'll provide the DB abstraction and wrappers required for paging, but you'll have to deal with presenting the data.

I know ZF better than the others, and it has Auth and ACL modules that are pretty easy to use, but it's not just a case of drag+drop to get a fully working login/membership system. I think Symfony has a 'plugin' that will generate the CRUD for user-management, but I'm not sure how it works or how flexible it is.

As for tabs and popups, then that's beyond the realm of PHP and you'll be looking at Javascript widgets, of which there are thousands.
posted by gregjones at 2:07 AM on April 20, 2008


You're looking for a web framework. For different styles...

Cool kids: Ruby on Rails.

Enterprise: Java Servlets (Java Faces will give you the "controls"). I don't know what the popular .NET version is.

Dark Wizards: Catalyst (Perl).

The insane: Rails on Rhino (Javascript in the JVM).

The PHP kids still haven't even figured out their language, let alone realize they need a kick ass MVC framework with ORM. All the ones I've looked at suck compared to the more mature ones listed above. My days would be so much more joyous if someone would finally write a Java Persistence, ADO, or DBIx::Class for PHP.

Meanwhile, I cry myself to sleep at night.
posted by sbutler at 2:08 AM on April 20, 2008 [1 favorite]


I would suggest VB.NET as a better choice for you. Google some tutorials, its ridiculously easy.
posted by mphuie at 3:16 AM on April 20, 2008


ASP.NET or Ruby,

But sorry mphuie, I have to disagree. C# over VB.NET.

VB is not only a dangerous cult but a dying language. I would always recommend people use ECMA based syntax over VB's tortured weirdness.

Having said that, PHP has a massive developer community, and a gazillion examples of pretty much anything you want to build. Hosting is also really easy to come across. It's also an OK language.

If you are on the windows platform I recommend you download WAMP (Windows Apache MySQL PHP) - This makes installation etc a breeze.
posted by mattoxic at 5:04 AM on April 20, 2008


PHP is a great language and has some awesome table-gateway pattern database libraries, as well as some good ORMs (Most notably: Doctrine.)

The reason that PHP doesn't have most of the abstract weirdness that a lot of other languages have is that the language is so simple. It's easy to just mix up a bunch of HTML and some variables and have a database-driven page. It's also easy to extend it out to the nth degree and have a fully OO code library like Zend Framework. Zend Framework, by the way, DOES offer .net-style generated code elements (although no datagrids -- those become a pain in the arse with the web) ... check out Zend_Form. All the really cool PHP kids use Zend Framework these days. Symony was faster to market and has better tutorials, but there's really no comparison in flexibility.

Code Igniter, CakePHP, et.al. are php4 frameworks, which you want to avoid... they're not fully OO.
posted by SpecialK at 5:42 AM on April 20, 2008


Oh, and one thing you have to keep in mind moving from .net web programming to PHP programming is that the web is stateless. That is, the request and the response are the only thing you do in a transaction. You receive a request from the client, you deliver a response, and move on.

You can't depend on getting that request back again. Therefore, you don't really have data-bound controls -- you have to be sure that you set things like a hidden field with the primary key in it so that you can get that row back OUT of the database when the next request comes in, use it to process some data, and deliver another response. Therefore, the data is bound only to control and it's up to you in your code to translate between the named request variables that you were given by the client, and the data inside your database, and then back into the HTML response.

I've found this isn't always clear to programmers who are dealing with the web the first time, and ESPECIALLY not to people who are coming from microsoft languages, who tries to abstract this difference. Don't do that. Abstracting that part only leads to PAIN.
posted by SpecialK at 5:47 AM on April 20, 2008


Prado is a cool PHP framework that has a lot in common with ASP.NET. It has events, controls and a lot of good stuff. I played with it a couple of years ago and I was quite impressed and it seems to have been steadily improving since then.

That said, the main reason that I don't use it now is simply because I moved to ASP.NET with C# which means that I don't have a compelling reason to use PHP. I have a reliable hosting package that gives me ASP.NET and SQL Server for about the same price as PHP and MySQL.
posted by tetranz at 8:23 AM on April 20, 2008


« Older I take showers every day! Really!   |   What Are The "Classic" Movies That Modern Kids... Newer »
This thread is closed to new comments.