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

How to enable profiling in CodeIgniter

category:  CodeIgniter, Web development

When you are developing the application or website with CodeIgniter, you should enable the profiling feature. It will help you see the useful data such as Benchmarks, data from $_GET, memory usage, data from $_POST, URI string, class/method, active databases, HTTP headers, session data, config variables. To enable it, you will add the code to your controller. I add the profiling enable in the __construct method of my class. It is important you must add “parent::__construct()” in the __construct method. … Read More

How to Connect Multiple Database in CodeIgniter

category:  CodeIgniter, Web development

Last week, I wrote the basic CodeIgniter3 tutorial series. I picked the CodeIgniter3 for my small web application because it is lightweight, flexible and really fast development. My project had the very tight deadline so CodeIgniter was the perfect one. I would suggest the PHP developer who never worked on the Model-View-Controller (MVC) pattern to start with CodeIgniter3. For the PHP developers who have experiences for development, can learn the CodeIgniter very quick. I learned within 2 days. In my … Read More

Creating a Web Application with PHP and CodeIgniter – Part 4 (Final)

category:  CodeIgniter, Web development

In part 4, we will learn how to add the new data via a form. Part 4 is the final part of the CodeIgniter3 tutorial series. In part 3, we can read the data from a database using Query Builder from CodeIgniter. We create the database and table via phpMyadmin. We, also add a new record in the table via phpMyadmin. In this part, we will add a new record via an adding form. Create a form In this part, … Read More

Creating a Web Application with PHP and CodeIgniter – Part 3

category:  CodeIgniter, Web development

In part 3, we will learn how to create a Model, View, and Controller in CodeIgniter. Also, we will learn the routing. Setting up a model Models are the place where you retrieve, insert, and update data in your database. Basically, the Models represent your data from your database. The example in this part 3, it comes from CodeIgniter tutorial website. If you like to read more detail, you can visit that tutorial. In part 3, I intend to keep … Read More

1 2 3 4 5 6 13