1

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 popular frameworks and built around a relational schema? Thanks in advance.

7
  • To the dude who put vote down: Don't be so lame and cynical! Cite the rationales for your behavior! Others will benefit from my question. Commented Jan 3, 2010 at 9:56
  • Well, I didn't vote you down, but frankly, your question doesn't make much sense. What exactly are you looking to do? Commented Jan 3, 2010 at 9:59
  • I want a tool that generates PHP code based on SQL schema and avoid using syntactic sugar which has 2 drawbacks: Performance overhead and unrecognizable by PHP IDEs. Commented Jan 3, 2010 at 10:03
  • Built on a schema how? Can you give an example use case? Commented Jan 3, 2010 at 10:07
  • 3
    So, you're looking for an ORM? Well, I'm not a PHP dev, so I could be wildly off here, but have you checked out Doctrine? doctrine-project.org Commented Jan 3, 2010 at 10:18

6 Answers 6

5

I think Symfony has something that you might find interesting.

Sign up to request clarification or add additional context in comments.

Comments

2

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.

Comments

1

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.

Comments

1

Zend_Framework has code generator called Zend_Tool, tough it's still unstable.

1 Comment

Thanks erenon. Did not know until you told :)
1

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.

Comments

1

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.