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
Moving from .NET to PHP
Moderator: General Moderators
- Jonah Bron
- DevNet Master
- Posts: 2764
- Joined: Thu Mar 15, 2007 6:28 pm
- Location: Redding, California
Re: Moving from .NET to PHP
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.
Re: Moving from .NET to PHP
.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
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
Re: Moving from .NET to PHP
I think I read somewhere that then new Visual Studio will support PHP.
Re: Moving from .NET to PHP
I thought it was using the Strategy design pattern:josh wrote:It uses the decorator design pattern so that I can change the markup for 1,000 forms at once, if I wanted.
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
Re: Moving from .NET to PHP
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.