Moving from .NET to PHP

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
rhether
Forum Newbie
Posts: 1
Joined: Sat Oct 23, 2010 11:11 pm

Moving from .NET to PHP

Post by rhether »

Hello All,

I have been programming for a year in .NET using Visual Studio and am now required to learn PHP for work.
I am used to using an IDE such as Visual Studio where I can quickly build forms, and add controls, etc.

In PHP, how does one create their forms, and add controls. Is it all done by hand in an editor ?
I have Netbeans as it handles PHP code writing, but I do not see a method to design forms.

Appreciate any advice.

Thanks, Rick
User avatar
Jonah Bron
DevNet Master
Posts: 2764
Joined: Thu Mar 15, 2007 6:28 pm
Location: Redding, California

Re: Moving from .NET to PHP

Post by Jonah Bron »

Yes, forms are usually made by hand with a HTML editor. I recommend using Eclipse for PHP, though I really can't compare it to Netbeans as I've never used it.
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Re: Moving from .NET to PHP

Post by josh »

.NET is a framework. There are many PHP equivalents. I certainly do not write my forms by hand (except in rare cases) http://framework.zend.com/manual/en/zend.form.html

It displays my forms, localizes them, validates them, filters the inputs, renders validation messages, escapes my data, etc.. It uses the decorator design pattern so that I can change the markup for 1,000 forms at once, if I wanted.

You can extend and add your own element types. For example maybe you want 'Expiration Date' field to be used in multiple forms, to be composed of two select boxes - you can create & extend your own element types, and re-use them in your forms. Same with creating custom validations, etc..

Forms can also be hierarchically composed, so lets say you built an address form. You could have a 'user profile' form that has 2 address forms ( mailing & street). So you can re-use whole entire forms, elements, etc..

You can even use your forms to validate & filter data coming in from your Web APIs
Doug G
Forum Contributor
Posts: 282
Joined: Sun Sep 09, 2007 6:27 pm

Re: Moving from .NET to PHP

Post by Doug G »

I think I read somewhere that then new Visual Studio will support PHP.
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: Moving from .NET to PHP

Post by VladSun »

josh wrote:It uses the decorator design pattern so that I can change the markup for 1,000 forms at once, if I wanted.
I thought it was using the Strategy design pattern:

http://framework.zend.com/manual/en/lea ... intro.html
Zend_Form utilizes the decorator pattern in order to render elements and forms. Unlike the classic » decorator pattern, in which you pass an object to a wrapping class, decorators in Zend_Form implement a » strategy pattern, and utilize the metadata contained in an element or form in order to create a representation of it.
There are 10 types of people in this world, those who understand binary and those who don't
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Re: Moving from .NET to PHP

Post by josh »

Correct, these decorators are not used by wrapping the Zend_Form class, but rather the Zend_Form class uses 'rendering' strategies that themselves can be decorated. Technically they implement both decorator & strategy patterns.
Post Reply