![]() |
CI generator for crud (bash and php) 0.1 - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: CI generator for crud (bash and php) 0.1 (/showthread.php?tid=13867) |
CI generator for crud (bash and php) 0.1 - El Forum - 12-21-2008 [eluser]MikeHibbert[/eluser] Great! glad it works on some else system ![]() If anyone else has test this and has feedback please post Mike CI generator for crud (bash and php) 0.1 - El Forum - 12-22-2008 [eluser]Dreammaker[/eluser] Ooops. Mike, I hurried. I tested the generator, but not generated classes ![]() Example for MVCs based on default yaml (poo.yml) Code: A PHP Error was encountered Code: A PHP Error was encountered And another same warnings in view: Code: Message: Undefined property: CI_Validation::$name Code: Message: Undefined property: CI_Validation::$cheese Code: Message: Undefined property: CI_Validation::$cheese2 CI generator for crud (bash and php) 0.1 - El Forum - 12-22-2008 [eluser]Dreammaker[/eluser] Hm, this errors occured cause generator takes fieldnames from command line arguments. But if we have a yaml-file we should base the work on it (or not?). Also if roman@sunion:~/public_html/test$ php crud/create a poo name address cheese cheese2 We have in view: Code: <textarea name="address" id="address"><div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;"> 'cause : Code: <label for="address">address</label><textarea name="address" id="address"><?=$address?></textarea><br/> <?=$address?> CI generator for crud (bash and php) 0.1 - El Forum - 12-23-2008 [eluser]MikeHibbert[/eluser] Hey Dreammaker Ok so you have create the table for yourself in phpmyadmin or whatever mysql admin you use, and it has the feilds in there first? The generator doesn't as yet create tables or fields in mysql, although I think it should myself. So, as a result CI is looking for variables that arent being created from database. That's my first reaction of course, other things to check for is that you run the command with the 'a' option first, which you appear to have done. Let me know if you've already done that and I will try and recreate the errors myself. Mike CI generator for crud (bash and php) 0.1 - El Forum - 12-23-2008 [eluser]MikeHibbert[/eluser] Also, The yaml is only used at the moment to create the actual forms in the views. So currently, when you run the generator you will need to have the table and fields on the command too. Mike CI generator for crud (bash and php) 0.1 - El Forum - 12-23-2008 [eluser]Dreammaker[/eluser] Code: CREATE TABLE IF NOT EXISTS `poo` ( Code: roman@sunion:~$ cd ~/public_html/test Code: <form action="/poo/add" method="post"> CI generator for crud (bash and php) 0.1 - El Forum - 12-23-2008 [eluser]MikeHibbert[/eluser] Ok its seems its all my fault ![]() I fixed this error and it seemd to be fine now. I've attached the new version so you can give that a whirl ![]() Mike CI generator for crud (bash and php) 0.1 - El Forum - 12-23-2008 [eluser]Dreammaker[/eluser] After redirect Code: A PHP Error was encountered ![]() CI generator for crud (bash and php) 0.1 - El Forum - 12-23-2008 [eluser]MikeHibbert[/eluser] you need to add a unique key to your table called 'id' for every table you want to use with the system too: Code: CREATE TABLE IF NOT EXISTS `poo` ( Then you wont be making duplicate entries in the DB Mike CI generator for crud (bash and php) 0.1 - El Forum - 12-23-2008 [eluser]Dreammaker[/eluser] Ok. It works. ![]() Next bugs: 1. In "Edit" mode Textarea is not filled. 2. Also in "Edit" mode a file field works as new field and it generates error when form is submitted. |