me23
(Yii)
October 29, 2008, 8:49pm
1
Hello All,
I extended the yii-CLI with a new commands to generate model and crud for all Tables in Database automaticly.
Just place the file in following yii-framework-path: yii\framework\cli\commands\shell
The generated classes are not fully tested. So use it with no warrenty
Greetings from Germany
me23
qiang
(Qiang Xue)
October 29, 2008, 8:52pm
2
It looks nice!
I would suggest that the customized shell commands are put under protected/commends/shell instead of the framework directory.
qiang
(Qiang Xue)
October 29, 2008, 8:55pm
3
Also, the modelAll command is only for MySQL.
imasia
(Paul Apostol)
March 26, 2009, 11:55am
4
Hello everybody,
This is my first post (and is in a very old theard )
I start to test it and the commands are not seen in the framework location. Instead are seen in the application. I added the YIIPATH at the require_once.
I can generate the models but not the CRUD because the indexes in my tables. After I'll fix the tables I'll check again if everything is working.
Paul
Edit:
Looks like it's working but the question is:
Why "crudall" cmd generates only 'create','update','list','show'? "crud" cmd has as an extra 'admin','_form'. I add them and works like a charm.
Thanks a lot, it help me a lot.
me23
(Yii)
March 28, 2009, 8:02am
5
Hi imasia,
good to hear that it helped you a bit.
You answered your question already by yourself: very old thread
When this commands are written, there were no "admin and "_form" views in the framework…
Maybe you want to share your changed version here…
Greetings from Germany.
me23
imasia
(Paul Apostol)
March 30, 2009, 5:54pm
6
Hello,
I really didn't changed much. I just couldn't put the command in the framework (I liked to) and I put them in the site (protected\commands\shell).
I modified line 12:
require_once(YII_PATH.'/cli/commands/shell/CrudCommand.php');
Same for modelall, but the file name.
Only in crudall I've changed line 84 by adding 'admin' and '_form' in the array.
Attached you wil find only crudall because in the end I used for model generation mwbmodel and not a big change in modelall.
Good luck,
Paul
Greetings from Romania
Anybody knows what happens to the attachment on this thread? They seem to be missing.
mikl
(Mike)
November 22, 2009, 12:54pm
9
Unfortunately they seem to got lost with the forum update:
http://www.yiiframew …system-updated/
me23
(Yii)
November 22, 2009, 2:12pm
10
Hi,
here is my current version, hope it works for you, because it was long not used…
Greetings from Germany
me23