CodeIgniter Framework

24

Transcript of CodeIgniter Framework

Page 1: CodeIgniter Framework
Page 2: CodeIgniter Framework

Disclaimer: This presentation is prepared by trainees of baabtra as a part of mentoring program. This is not official document of baabtra –Mentoring PartnerBaabtra-Mentoring Partner is the mentoring division of baabte System Technologies Pvt . Ltd

Page 3: CodeIgniter Framework

Niyaz

[email protected]

tweetboy

Niyazsky

+91 9746 049 048

in/niyazsky

Page 4: CodeIgniter Framework

Intro of CodeIgniter

CodeIgniter (CI) is one of popular php framework. If you are already building PHP Application, CodeIgniter will help you to do it better and more easily. With CodeIgniter, you can save time, make your web more robust, your code will be easier to read and maintenance. It is free, lightweight, and simple to install..

With CodeIgniter, you can cut down the amount of code you need to type. This is not just good for lazy, but: less type, fewer mistake, and less time for spend debugging.

Page 5: CodeIgniter Framework

ModelViewController

Page 6: CodeIgniter Framework

CI Database Configuration

Search Google CodeIgniter or http://ellislab.com/codeigniter | Copy to Server

Change Default Controller | Config->routers -> Default Controller

Calling a Function to load | $this->functionname();

Page 7: CodeIgniter Framework

Models

Model -------<?php

class Math extends CI_Model{

public function add(){

return 1+1}}

Controller---------

public function addStuff(){

$this->load->model("math");$this->math->add();

}

$this->addStuff();

Page 8: CodeIgniter Framework

How to Pass to Views

Controller View

Page 9: CodeIgniter Framework

Data Passing to MVC [1/3]

Controller

Page 10: CodeIgniter Framework

Data Passing to MVC [2/3]

Model

Page 11: CodeIgniter Framework

Data Passing to MVC [3/3]

View

Page 12: CodeIgniter Framework

URLs |mod_rewrite | URIs s

Create file .htaccess | Open and Correct Rewrite Base

Check rewrite module is on in Local Apache Server

Last Open -> Config Folder -> Config-> remove index.php

https://github.com/EllisLab/CodeIgniter/wiki/Removing-index.php-in-codeigniter-xampp-for-windows

Page 13: CodeIgniter Framework

Connecting DataBase

Open -> Config Folder -> autoload->

Create the Database

Open database.php within CodeIgniter\system\application\config. Set config like below:

Page 14: CodeIgniter Framework

Get Value from Database [1/3]

Controller

Page 15: CodeIgniter Framework

Get Value from Database [2/3]

Model

Page 16: CodeIgniter Framework

Get Value from Database [3/3]

View

Page 17: CodeIgniter Framework

Insert Value in Database [1/2]

Controller

OR

Page 18: CodeIgniter Framework

Insert Value in Database [2/2]

Model

OR

Page 19: CodeIgniter Framework

Update Value in Database [1/2]

Controller

OR

Page 20: CodeIgniter Framework

Update Value in Database [2/2]

Model

OR

Page 21: CodeIgniter Framework

Delete Value from Database [1/2]

Controller

Page 22: CodeIgniter Framework

Delete Value from Database [2/2]

Model

Page 23: CodeIgniter Framework

QUESTIONS SECTION

Page 24: CodeIgniter Framework

If this presentation helped you, please visit our page facebook.com/baabtra and like it.

Thanks in advance.

www.baabtra.com | www.massbaab.com |www.baabte.com