Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
开发者_运维知识库Closed 9 years ago.
Improve this questionI wonder if there is an ongoing opensource project somewhere that mimics the MVC architecture implementation of ASP.NET MVC in PHP. Some of the key features would be:
- Model Binders
- Route Mapping
- Data Annotations
- Action Attributes
- Action Results
- Areas
- Partials
- Shared Views (w/ Master Page)
Here are some data I have gathered
- Model Binders for Yii 2.0 suggestion by MindPlay
- Source Code Annotations (Attributes) by MindPlay
In my opinion, the core feature that enables ASP.NET MVC and sets it apart from most PHP frameworks, is the extensive use of annotations and reflection - the ability to write a reusable specification for the domain model, and have all the view/binding/persistence/ajax/other components automatically use the metadata embedded in those specifications, is what makes way for a lot of the DRY-ness that I personally enjoy in ASP.NET MVC.
I don't know of a single PHP framework that takes all of the ideas from ASP.NET MVC and gives them to you in one package.
Recess uses annotations extensively, and in that way may be somewhat similar to ASP.NET MVC.
Symfony 2 relies on Doctrine for persistence and annotation support, and may be somewhat similar in that way too.
Yii, as you clearly already know, has support for a lot of the other features - partials, areas, routing and (very basic GET parameter) binding. What's missing is a real binder, annotations, and a template system. (not a template engine, which it has, but something along the lines of ASP.NET MVC's EditorFor helper.)
Personally, I swear by Yii, although I'm frequently tempted to tinker with Recess - it appears to have the fullest use of annotations I've seen in a PHP framework so far.
On a related note, I am not really impressed with any of the annotation engines currently available for PHP, and certainly not with any of the proposed language extensions - hence, I have been working for the past year on an annotation engine of my own; if you're interested, you can read more about my reasons for doing this here. I am hoping to announce the first public release in the next month or so.
Wonder if you've heard of Cake PHP. (Its open source)
See http://cakephp.org/
Features:
- Model, View, Controller Architecture
- Application Scaffolding
- Code generation via Bake
- Helpers for HTML, Forms, Pagination, AJAX, Javascript, XML, RSS and more
- Access Control Lists and Authentication
- Simple yet extensive validation of model data
- Router for mapping urls and handling extensions
- Security, Session, and RequestHandler Components
- Utility classes for working with Files, Folders, Arrays and more
Also see Comparison of Web Application Frameworks.
精彩评论