您的位置:首页 > 编程语言 > PHP开发

Laravel-4-Generators

2013-05-02 00:00 162 查看
地址:https://github.com/JeffreyWay/Laravel-4-Generators

很方便,可以帮助你生成很多重复的代码。

不过如果你的model是自定义表的话,会有问题。

修改

FormDumperGenerator.php

public function getTableInfo($model)

public function getTableInfo($model)
{
$table = Pluralizer::plural($model);
return \DB::getDoctrineSchemaManager()->listTableDetails($table)->getColumns();
}


修改如下

public function getTableInfo($model)
{
$tclass = new $model();
$table=$tclass->getTable();
if (is_null($tclass->getTable()))
$table = Pluralizer::plural($model);

return \DB::getDoctrineSchemaManager()->listTableDetails($table)->getColumns();
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息