1
我想从控制器中的操作生成“schema.php”。我试过了:CakePHP 2:如何从Controller中的SchemaShell类运行方法生成
$m = new SchemaShell();
$m->params = array('force');
$m->generate();
但这不起作用。显示几个通知。
如何使它工作?
谢谢。
我想从控制器中的操作生成“schema.php”。我试过了:CakePHP 2:如何从Controller中的SchemaShell类运行方法生成
$m = new SchemaShell();
$m->params = array('force');
$m->generate();
但这不起作用。显示几个通知。
如何使它工作?
谢谢。
解决方案:
$m = new SchemaShell();
$m->params = array('force' => 1, 'file' => 'schema.php');
$m->startup();
$m->generate();