How to delete data from Datatable plugin using Bootstrap modal in CodeIgniter

category:  CodeIgniter, Web development

Recently, I wrote two posts about adding and editing the data in the Bootstrap modal in CodeIgniter. Today I will share how to delete the data using Bootstrap modal in CodeIgniter. Let’s do it. Add new delete control in DataTable Assume you already integrate the DataTable plugin to your template. If not, you can follow this post for integrating the DataTable plugin to your template in CodeIgniter. Open your footer template and add the JavaScript code below. This script must … Read More

How to edit data from Datatable plugin using Bootstrap modal in CodeIgniter

category:  CodeIgniter, Web development

In the last post, I wrote, “How to add data from Datatable plugin using Bootstrap modal in CodeIgniter” I show only adding new data. In this post, I will share how to edit data via Bootstrap modal. Let’s go. Add a new column for the controller in the view page In the template, we add the new column in the table tag. This table will use for the DataTable plugin. Add the edit control in the footer template Open your … Read More

How to add data from Datatable plugin using Bootstrap modal in CodeIgniter

category:  CodeIgniter, Web development

Datatable plugin is one of the popular JavaScript plugins. It displays the data in the table style. It comes with pagination, instant search, and column sorting out of the box. However, in the user’s view, they want to be able to add, edit, or delete the data from the Datatable without leaving the current page. We can do that by using Ajax and the Bootstrap modal. In this post, I will share with you how to add data from Datatable … Read More

How To Use DataTables In Codeigniter

category:  CodeIgniter, Web development

When you work on a web application or the back-end of your website, you often create reports for the users. The reports will display in the table style. Also, you will have the requirements from the users to add the pagination, search, ability to select the number of records per page, and export data as Excel, CSV, and PDF file. Those features can be done with Datatable plugin. What is Datatable plugin Datatable plugin is an advanced interactive control JavaScript … Read More

How To Integrate Bootstrap 4 in Codeigniter

category:  CodeIgniter, Web development

A couple weeks ago, I wrote a CodeIgniter3 tutorial series. In the series, there is no CSS framework integrating into the application. Today, I will share with you how to integrate one of the popular CSS frameworks which are Bootstrap4 into CodeIgniter. In my CodeIgniter3 tutorial series, the application looks like this. The template was created by HTML and CSS only. In this post, we will integrate the Bootstrap 4 framework and turn the plain web page to something likes … Read More

How to enable PHP error logging in CodeIgniter

category:  CodeIgniter, Web development

When you deploy your application to the production server, it is a good practice that you enable the PHP error logging file for your application. Because we don’t enable the PHP error reports on the production, we will create the error logging file to collect the PHP error on the production for us. In CodeIgniter, enable the error logging is simple since CodeIgniter has this function built-in. Below is the steps you can follow. Make your application/logs folder writable on … Read More

How to remove index.php from URLs in CodeIgniter

category:  CodeIgniter, Web development

By default, the index.php will be included in the URLs as it shows below. “https://example.com/index.php/users/login” You can remove the index.php by following the steps below. Apache server If you use the Apache server and have mod_rewrite enabled, you can remove the index.php by using a .htaccess file. Below is the code you will place into your .htaccess file. If you don’t have this file yet, you can create one. Next, open application/config/config.php and look for $config[‘index_page’] and remove index.php. Below … Read More

How to use auto-loading resources in CodeIgniter

category:  CodeIgniter, Web development

if you are a web developer and familiar with the modern web framework, you may know the auto-load feature. CodeIgniter provides the auto-load feature that loads the libraries, helpers, packages, drivers, custom config files, language files, and models automatically every time the system runs. The auto-load feature is useful when you need the specific resources available throughout your application. Keep it in mind, you should load only the resources that you will need often in your application in the auto-load … Read More

How to define constants globally in CodeIgniter

category:  CodeIgniter, Web development

When you are developing the web application, you want to set the constants that you will use in the application globally. For example, you want to set the application name, application version or salt key for encrypt the password. In CodeIgniter, it provides the place for this purpose. Constants.php In application/config/constants.php, it is a file that you can define your constants globally. In the constants.php, you will see some constants in there. Go to the end of file and add … Read More

What I normally set the index.php in CodeIgniter

category:  CodeIgniter, Web development

When you are developing the web application, you normally develop on your localhost (your computer). You will set up your ENVIRONMENT differently from production. For example, you will display the PHP report error while you are developing on your localhost but on the production, you will disable the PHP report error. Today I will share how I normally set the index.php for my CodeIgniter project. Index.php at the webroot Below is what I normally set the index.php at the webroot. … Read More