As far as I know, many PHP frameworks use syntactic sugar to provide illusion of real functions. Some provide scaffolding/skeleton generation, which is limited. Syntactic sugar is slow and IDE/editors do not provide intellisense for Syntactic sugar functions/methods and member data. I'm wondering if there any tool/framework to generate PHP code based on some popu开发者_如何学编程lar frameworks and built around a relational schema? Thanks in advance.
I think Symfony has something that you might find interesting.
Try Zend Framework.
Zend Framework (ZF) is an open source, object-oriented web application framework implemented in PHP 5 and licensed under the New BSD License.
I found QCodo http://www.qcodo.com/wiki/article/background/metaprogramming which satisfies requirements. Thank you very much for participating. You all earned my vote.
Zend_Framework has code generator called Zend_Tool, tough it's still unstable.
Zend_CodeGenerator
For posterity, I thought I would mention the rather impressive solution I just found to this problem.
Zend_CodeGenerator was added to Zend Framework as of, I believe, version 1.8, and I'm very impressed with it so far. Like most ZF components, it works just fine as a standalone tool; you needn't implement the rest of the framework in your project.
So far it seems easy to use and quite powerful.
Have a look at Cygnite Framework's Crud generator. It is very simple and easy to use. The New Cool Kid build on Symfony2 console component, I found interesting, made my job simple and fast.
Cygnite CLI generates controller, model, views, layout, form component, required field validation, pagination etc. with a simple command.
php cygnite generate:crud controller_name table_name database_name
You may alter the code based on your need.
Have a look, may help someone.
Generate CRUD application within 2 minute
Cygnite Framework Code Generator
精彩评论