CodeIgniter Forums
Model and Controller Generotor for CI - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forum-22.html)
+--- Thread: Model and Controller Generotor for CI (/thread-23750.html)



Model and Controller Generotor for CI - El Forum - 10-21-2009

[eluser]imn.codeartist[/eluser]
Dear CI friends,

Please find the attached file of CodeIgniter Model and Controller Generator.

Its simple and very easy to use.

At the moment it only supports Php Mysql.


Steps to use:

1) download generator.zip file and extract in your htdocs.

2) There will be index.php and once you run it, it will ask for hostname, username, password, database name and so on.

3) Once you finish, click on the generate button then it will create a folder of your database name and there will be 2 folders controller and models, you can find generated models and controllers over there.

4) copy them and place in your codeigniter application and use them.

5) You are done.

Any comments are welcome or you can email me for more information.

Regards
Dixanta Shrestha
[email protected]


Model and Controller Generotor for CI - El Forum - 10-21-2009

[eluser]gawronzo[/eluser]
Hi Dixcoder!

Thanx for nice upload. It works fine. I looked for something like this. Script generates only clean CRUD objects. What do you think about adding getters and setters? And about moving
Code:
$this->load->view('');
from controller constructor to index function?

You should change line 50 to:

Code:
<?php



Model and Controller Generotor for CI - El Forum - 10-21-2009

[eluser]imn.codeartist[/eluser]
Hi, thanks for your interest.At the moment I am focusing on generating models.

During the time of creating I also generate controllers as well for making easy. Soon I will update them as I have just released the first version.


Model and Controller Generotor for CI - El Forum - 10-21-2009

[eluser]cliffoliveira[/eluser]
interesting
I'm really looking for such a service that helps in the creation of CRUD and Models in general
I do a test and wait for progress
grateful


Model and Controller Generotor for CI - El Forum - 10-21-2009

[eluser]Jônatan fróes[/eluser]
I'll try.
Thanks for sharing!


Model and Controller Generotor for CI - El Forum - 01-10-2010

[eluser]Unknown[/eluser]
Thanks dixcoder, I started to modify it a little.. I start with a little bit different setup using jQuery Pagination and the Authentication Library...

I have modified the creator so that it will create all files needed to perform basic table functions. The Model, View, and controller are created. Views are placed in their own directories IE: /view/<table_name>/index.php, add.php, edit.php etc...

I will gladly post if you like?


Model and Controller Generotor for CI - El Forum - 01-11-2010

[eluser]Unknown[/eluser]
I keep getting the following errors:

Code:
PHP Warning:  mysql_fetch_array() expects parameter 1 to be resource, boolean given in /path/to/generator/index.php on line 122

PHP Warning:  fwrite() expects parameter 1 to be resource, boolean given in /path/to/generator/index.php on line 164

PHP Warning:  fclose() expects parameter 1 to be resource, boolean given in /path/to/generator/index.php on line 165