| lesson material | material summary | questions and answers | definitions | types and examples | other information | materi pelajaran | ringkasan materi | pertanyaan dan jawaban | definisi | jenis-jenis dan contoh-contoh | informasi lainnya |
Bootstrap is a CSS framework that is popular in web development. Even Petanikode templates are also made with Bootstrap.
In this tutorial, we will not discuss bootstrap in detail. Because I've made a bootstrap tutorial in a different article.
If you don't understand bootstrap ...
... calm down, just follow this tutorial while studying.
Later you will understand yourself, hehehe.
Continue ...
The plan is for the application that we will create, we will use the SB Admin template .
Why SB Admin?
Because it's simple, creative, using Bootstrap 4 , and easy to implement on CodeIgniter.
Display SB Admin Template
Steps that must be done to use bootstrap (SB Admin template) on Codeigniter:
Codeigniter configuration;
Download SB Admin;
SB Admin Extract;
Copy the file assets needed;
Making Templates;
Make a partial template;
Use partial on the template;
Finish ...
It sounds easy, but in practice, we will get many obstacles and problems.
Therefore, make sure you follow this tutorial carefully.
1. Initial Codeigniter Configuration
Before starting to create a template, please configure it first ...
Base URL configuration
Base URL serves to determine the address or URL that will be used by the web.
When developing the web, we will use the following Base URL:
http://localhost/tokobuah
This is the address that we can access from localhost.
When the web has finished, then change the address to the domain address.
Example:
https://www.petanikode.com
How to set the Base URL, please open the file config/config.php. Then fill in the section$config['base_url'] = ''; like this:
Configure Autoload
Next we have to load a helper into memory automatically throughautoload.php .
Helper is a Codeigniter function that will help us in various ways, such as: creating forms, accessing URLs, etc.
One of the helper we need in making templates is a helperurl .
Helper urlcontains functions for accessing a URL such as base_url(), site_url(),$this->uri , etc.
How to activate the helper url:
First open the file config/autoload.php, then search $autoload['helper']. Add url, so that it looks like this:
Making Constants
After that, create a constant SITE_NAMEto save the web name. We will need this constant to retrieve the web title in the template.
If you don't understand about constants in PHP, please read:What are Constants?
Continue ...
Please open the file config/constants.php, then add the following code ...
/*
|--------------------------------------------------------------------------
| Constants for Site
|--------------------------------------------------------------------------
|
*/define('SITE_NAME','Tokobuah');
0 Komentar untuk "Tutorial Codeigniter # 3: How to Use Bootstrap on Codeigniter"
Silahkan berkomentar sesuai artikel