starting php again after a .Net coma

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
peroija
Forum Newbie
Posts: 1
Joined: Wed Aug 24, 2011 11:04 am

starting php again after a .Net coma

Post by peroija »

I think this fits the theory area... but please correct me if I am wrong.

I've used php for a few class projects in grad school, making me still a PHP noob. I graduated and got a job as a developer. For the past two years I have lived and breathed .net (C#). Recently I decided to start doing php driven sites for some friends and have realized how warped my mind is after using .net NONSTOP.

I need help drawing a parallel between the two so that I can more easily re-pickup PHP. In .net there is a clear separation between back end code (code behind file, .cs) and front end code (.aspx) [yes I do know that the front end does contain some server side scripting, but not nearly as much as the code behind] If I remember correctly PHP mixes back end and front code on the same page, or maybe that was just my poor programming techniques in school.

Anyways, am I able to create php pages in the same fashion as .net or am I forced to intermingle the code as I did in the past? Is there a better way? Hopefully someone can point me in the right direction :(
User avatar
Jonah Bron
DevNet Master
Posts: 2764
Joined: Thu Mar 15, 2007 6:28 pm
Location: Redding, California

Re: starting php again after a .Net coma

Post by Jonah Bron »

PHP lets you set up your program any way you want; it can work more as a page controller, or you can keep your business logic apart from the view, or whatever is best for your particular application. The pattern most frequently thrown at organizing code in PHP is Model-View-Controller (analogous to .NET MVC).

The quickest/easiest way to implement MVC in an application is to use an existing framework. A few popular ones are Zend, CakePHP, and Symfony.
Post Reply