Question

Is there any thing in PHP to create basic scaffold, like in Rails?

EDIT: I need something to prototype quickly..

Was it helpful?

Solution

Some frameworks like Symfony, CakePHP, Akelos, CodeIgniter and others have support for scaffolding.

However if you don't want to use a framework you can try phpScaffold which generates CRUD scaffold pages based on phpMyAdmin table exports...

OTHER TIPS

I also wanted some fast prototyping, but I wanted it to generate the code, so it's easy to update it. I made many improvements on phpScaffold (HTML5, nice CSS, many models at once, etc) which are published on http://github.com/tute/phpscaffold.

Phreeze makes this simple and easy. http://phreeze.com/

QCodo is another great option. And since it uses reflection to do Code Generation instead of reflection at runtime, you'll likely see better performance.

First, Rails is a framework. PHP is a language. PHP does not have built-in scaffolding support, just as Ruby--the language Rails is build on--does not. A framework like CakePHP, however, does support scaffolding.

Second, I see that you raised an objection to CakePHP because "you still have to do a bunch of stuff." That's true--with any framework, you're going to have to learn new conventions, configurations etc.

CakePHP got plenty of scaffolding options

If you throw Crud + API plugin on top, you basically got everything you need, with tons of nice additions

cakephp-crud: The active successor of the two projects below. Provides both Crud actions, API, Scaffolding, Searches and more

Crud Plugin: https://github.com/nodesagency/Platform-Crud-Plugin

API Plugin: https://github.com/nodesagency/Platform-API-plugin

They all utilize CakePHP events, so its really simple to extend and modify the default behavior

For myslef I Use CodeIniter for development, sure they have scaffolding, but only in terms of a "simple scaffolding" which mean you're not gonna use it in live product (i dunno about everyone but i'm only using it as some tools) .

but if you need some like CRUD generator you can use SparkPlug , or Ignition both of them can be used on Codeigniter

This was asked quite some time ago, but if it's still relevant check out this nice scaffolding class (check the demo)

Yiiframework has a good code scaffolding system called Gii. It's web based. Once you create the tables, you can generate the CRUD classes from within the browser. No command line needed. I like this scaffolding.

If you use CakePHP as the web framework it supports scafalding. See this link for more info. http://book.cakephp.org/2.0/en/controllers/scaffolding.html

I'm not sure what the SO policy is for dead thread revival but I figured I would add my own two cents in case none of the above solutions were satisfactory. If you're looking for a PHP-based MySQL scaffolding tool, check out AMPLE Scaffolder. The entire package is contained within a single PHP file (less than 200k) that can simply be dropped into a web accessible directory whereupon you have immediate access to local and remote MySQL databases based on the internal database permissions. No schema exporting, configuration files, or other hassles. Plus, there's a whole lot of other capabilities to offer as well. Just thought I'd share it in case you were looking for another option. Feel free to check it out and post feedback if you have any questions.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top