Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I am looking to translate my skills in .NET to PHP - specifically in regards to ASP.NET MVC. At work I am currently using .NET MVC 2.0 on a variety of projects and thoroughly enjoy the platform. Specifically I enjoy the very minimal configuration required to get a project up and running (just create the project, define routes, and start coding), as well as the ability for controller actions to return different items (i.e. ActionResult, JsonResult). Another piece I really like is the way the view/model interaction can be handled. For example I like being able to call return View(model) and having a view page (.aspx) load and having the full model object available to the view, regardless of the model type.

I'm looking for a PHP implementation of MVC that is the most similiar to what I am already familiar with. I don't anything apart from the MVC functionality. I've looked at Zend, Symfony, CodeIgniter, etc. and, while they look like they'll be fun to play with in the future, they provide much more functionality than I need. I'd prefer to write my own DAL, form helpers, delegate handlers, authentication/ACL pieces, etc. In short, I just need something to handle the routing and view interactions and will worry about the model implementation myself.

Can someone please point me to some lightweight code that accomplishes or comes close to accomplishing my objectives above. Or, can someone identify just the portions of a larger framework that do the same (again, I'm not currently interested in implementing something on a big framework, just the MVC portion and want to implement the model portion myself as much as possible).


migration rejected from stackoverflow.com Dec 3 '13 at 22:55

This question came from our site for professional and enthusiast programmers. Votes, comments, and answers are locked due to the question being closed here, but it may be eligible for editing and reopening on the site where it originated.

closed as off-topic by gnat, Bart van Ingen Schenau, GlenH7, Kilian Foth, Robert Harvey Dec 3 '13 at 22:55

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions asking us to recommend a tool, library or favorite off-site resource are off-topic for Programmers as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it." – gnat, Bart van Ingen Schenau, GlenH7, Kilian Foth, Robert Harvey
If this question can be reworded to fit the rules in the help center, please edit the question.

MVC Frameworks for PHP: Zend Framework, CakePHP, CodeIgniter, Kohana, Symphony, etc... Further info found in the PHP tag wiki stackoverflow.com/tags/php/info –  dqhendricks Jun 25 '11 at 18:11
Why do you want to rebuild the wheel? –  Demian Brecht Jun 25 '11 at 18:39
@Demian: Rebuilding a wheel is acceptable when you want to learn how to build a wheel. Let's hope that's what Tuck is after here –  Mchl Jun 25 '11 at 19:05
@mchl: Agreed, which is why I asked the question :) –  Demian Brecht Jun 25 '11 at 20:52

3 Answers 3

Good point about "the wheel" and performing work that isn't necessary - This is mostly a learning exercise - curious to try something I can immediately make useful based on my experience with MVC on a different platform.

It is highly doubtful that my office will ever require me to use PHP so this is solely to better myself as a programmer in general.

The most likely outcome will be the development of a lightweight CMS or some other specific tool that helps me better understand some PHP internals.

Thanks for the feedback.

If goal is to better yourself as a programmer you'd surely be better off doing this with a language other than PHP, which frankly isn't going to add much to your conceptual skillset if you're already a .NET developer. Have you considered Ruby or Python? –  Carson63000 Jun 26 '11 at 22:48

The last time I reviewed Zend Framework and CodeIgniter, they didn't force you to use all of their functions. You can just use the MVC implementation they offer.

Also, have a look at CakePHP.


It is highly doubtful that my office will ever require me to use PHP so this is solely to better myself as a programmer in general.

If you're doing this solely to become a better programmer and learn the internals of a language and how frameworks are built, then my suggestion is to take a run at building your own framework. Use frameworks such as Zend and Yii as a reference, but it sounds to me like you already know what you're shooting for.

Doing everything yourself will always give you greater insight to how things work (as you're doing this as an academic exercise) than forking off of something else. And who knows.. At the end of the day, you may have a complete package that you'll want to release to the OS community.

Good luck.