CIIG or codeigniter-ignator is codeigniter crud generator from database, which will simplify developer’s job who uses codeigniter framework.
We all know that codeigniter is one of the best light weight developer friendly framework for PHP.
Have you ever thought of creating an automatic form in codeigniter?
Here I have narrated a simple way to use this small application which can generate forms / CRUD generator for codeigniter.
Now let us see how this application can be used to generate a form.
As a developer we all know for creating an application we have to setup a database first. Once you have designed the database and the tables, you can download this codeigniter scaffolding (CRUD generator).
You can either download from github or from this blog.
Once downloaded you will get a zip folder which on extracting you will get a folder with following files:
After extracting, you need to make the following changes:
1. We have to change the config file base url in codeignator application/config/config.php
2. After that we have to change database setting in application/config/database.php
3. Before changing the database I am going to create a new database and a few tables inside that. The table create will look like as below:
Next we wil go to the main screen, where we can see the ciig crud generator form.
After that we need to give our table name here on table name text field., like that we will give the controller name and form title too.
Once we click on submit it will show 5 text boxes with PHP code.
– Model – (Here sample_table_model.php )
– Controller – (sample_table.php)
– List Form – (list_sample_table.php)
– Create Form – ( create_sample_table.php)
– Header structure – (header.php)
– Footer – (footer.php)
– Create form
– List form
We can copy and past this into the files with correct name as mentioned on that page or we can click download to get a zip folder.
Once downloaded, copy and past this into the controller, model and view folders we can access it from URL:
In our example http://localhost/ciig/index.php/sample_table
The page will look like as below:
On clicking the “create” link, it will go to create form
Once created we will see the list as below:
25,461 total views, 2 views today