SlideShare uma empresa Scribd logo
1 de 26
Submitted By 
Reshma vijayan .R
 Introduction 
 Why Framework not Scratch? 
 MVC ( Model View Controller) Architecture 
 What is CodeIgniter ???? 
 Application Flow of CodeIgniter 
 CodeIgniter URL 
 Controllers 
 Views 
 Models 
 CRUD operations 
 Session starting 
 Form validation 
 Q/A 
 Reference
 Key Factors of a Development 
 Interface Design 
 Business Logic 
 Database Manipulation 
 Advantage of Framework 
 Provide Solutions to Common problems 
 Abstract Levels of functionality 
 Make Rapid Development Easier 
 Disadvantage of Scratch Development 
 Make your own Abstract Layer 
 Solve Common Problems Yourself 
 The more Typing Speed the more faster
 Separates User Interface From Business Logic 
 Model - Encapsulates core application data and functionality Business 
Logic. 
 View - obtains data from the model and presents it to the user. 
 Controller - receives and translates input to requests on the model or the 
view 
Figure : 01
 An Open Source Web Application Framework 
 Nearly Zero Configuration 
 MVC ( Model View Controller ) Architecture 
 Multiple DB (Database) support 
 Caching 
 Modules 
 Validation 
 Rich Sets of Libraries for Commonly Needed Tasks 
 Has a Clear, Thorough documentation
Figure : 2 [ Application Flow of CodeIgniter]
URL in CodeIgniter is Segment Based. 
www.your-site.com/news/article/my_article 
Segments in a URI 
www.your-site.com/class/function/ID 
CodeIgniter Optionally Supports Query String URL 
www.your-site.com/index.php?c=news&m=article&ID=345
A Class file resides under “application/controllers” 
www.your-site.com/index.php/first 
<?php 
class First extends CI_Controller{ 
function First() { 
parent::Controller(); 
} 
function index() { 
echo “<h1> Hello CUET !! </h1> “; 
} 
} 
?> 
// Output Will be “Hello CUET!!” 
‱ Note: 
‱ Class names must start with an Uppercase Letter. 
‱ In case of “constructor” you must use “parent::Controller();”
In This Particular Code 
www.your-site.com/index.php/first/bdosdn/world 
<?php 
class First extends Controller{ 
function index() { 
echo “<h1> Hello CUET !! </h1> “; 
} 
function bdosdn( $location ) { 
echo “<h2> Hello $location !! </h2>”; 
} 
} 
?> 
// Output Will be “Hello world !!” 
‱ Note: 
‱ The ‘Index’ Function always loads by default. Unless there is a second 
segment in the URL
 A Webpage or A page Fragment 
 Should be placed under “application/views” 
 Never Called Directly 
10 
web_root/myci/system/application/views/myview.php 
<html> 
<title> My First CodeIgniter Project</title> 
<body> 
<h1> Welcome ALL 
 To My .. ::: First Project ::: . 
. . </h1> 
</body> 
</html>
Calling a VIEW from Controller 
$this->load->view(‘myview’); 
Data Passing to a VIEW from Controller 
function index() { 
$var = array( 
‘full_name’ => ‘Amzad Hossain’, 
‘email’ => ‘tohi1000@yahoo.com’ 
); 
$this->load->view(‘myview’, $var); 
} 
<html> 
<title> ..::Personal Info::.. </title> 
<body> 
Full Name : <?php echo $full_name;?> <br /> 
E-mail : <?=email;?> <br /> 
</body> 
</html>
Designed to work with Information of Database 
Models Should be placed Under “application/models/” 
<?php 
class Mymodel extend Model{ 
function Mymodel() { 
parent::Model(); 
} 
function get_info() { 
$query = $this->db->get(‘name’, 10); 
/*Using ActiveRecord*/ 
return $query->result(); 
} 
} 
?> 
Loading a Model inside a Controller 
$this->load->model(‘mymodel’); 
$data = $this->mymodel->get_info();
CRUD OPERATIONS IN MVC 
➱Create 
➱Read 
➱Update 
➱Delete
DATABASE CREATION 
//Create 
CREATE TABLE `user` ( 
`id` INT( 50 ) NOT NULL AUTO_INCREMENT 
, 
`username` VARCHAR( 50 ) NOT NULL , 
`email` VARCHAR( 100 ) NOT NULL , 
`password` VARCHAR( 255 ) NOT NULL , 
PRIMARY KEY ( `id` ) 
)
DATABASE CONFIGURATION 
Open application/config/database.php 
$config['hostname'] = "localhost"; 
$config['username'] = "root"; 
$config['password'] = ""; 
$config['database'] = "mydatabase"; 
$config['dbdriver'] = "mysql";
CONFIGURATION 
Then open application/config/config.php 
$config['base_url'] = 'http://localhost/ci_user'; 
Open application/config/autoload.php 
$autoload['libraries'] = array('session','database'); 
$autoload['helper'] = array('url','form'); 
Open application/config/routes.php, change 
default controller to user controller
Creating our view page 
Create a blank document in the views file (application -> 
views) and name it Registration.php /Login.php 
Using HTML and CSS create a simple registration 
form
public function add_user() 
{ 
$data=array 
( 
'FirstName' => $this->input- 
>post('firstname'), 
'LastName'=>$this->input- 
>post('lastname'), 
'Gender'=>$this->input->post('gender'), 
'UserName'=>$this->input- 
>post('username'), 
'EmailId'=>$this->input->post('email'), 
'Password'=>$this->input- 
>post('password')); 
$this->db->insert('user',$data); 
}
//select 
public function doLogin($username, $password) 
{ 
$q = "SELECT * FROM representative WHERE 
UserName= '$username' AND Password = 
'$password'"; 
$query = $this->db->query($q); 
if($query->num_rows()>0) 
{ 
foreach($query->result() as $rows) 
{ 
//add all data to session 
$newdata = array('user_id' => $rows- 
>Id,'username' => $rows->UserName,'email' => $rows- 
>EmailId,'logged_in' => TRUE); 
} 
$this->session->set_userdata($newdata); 
return true; 
} 
return false; 
}
//Update 
$this->load->db(); 
$this->db->update('tablename',$data); 
$this->db->where('id',$id); 
//delete 
$this->load->db(); 
$this->db->delete('tablename',$data); 
$this->db->where('id',$id);
SESSION STARTING 
<?php 
Session start(); 
$_session['id']=$id; 
$_session['username']=$username; 
$_session['login true']='valid'; 
if($-session['login true']=='valid') 
{ 
$this->load->view('profile.php'); 
} 
else 
{ 
$this->load->view('login.php'); 
}
FORM VALIDATION 
public function registration() 
{ 
$this->load->library('form_validation'); 
// field name, error message, validation rules 
$this->form_validation->set_rules('firstname', 'First 
Name', 'trim|required|min_length[3]|xss_clean'); 
$this->form_validation->set_rules('lastname', 'Last 
Name', 'trim|required|min_length[1]|xss_clean'); 
$this->form_validation->set_rules('username', 'User 
Name','trim|required|min_length[4]|xss_clean| 
is_unique[user.UserName]'); 
}
if($this->form_validation->run() == FALSE) 
{ 
$this->load->view('Register_form'); 
} 
else 
{ 
$this->load->model('db_model'); 
$this->db_model->add_user(); 
}
USEFUL LINKS 
 www.codeigniter.com
 User Guide of CodeIgniter 
 Wikipedia 
 Slideshare
THANK YOU

Mais conteĂșdo relacionado

Mais procurados

Webapps without the web
Webapps without the webWebapps without the web
Webapps without the webRemy Sharp
 
Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd
Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd
Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd Sencha
 
SenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web Apps
SenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web AppsSenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web Apps
SenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web AppsSencha
 
Sencha Roadshow 2017: Modernizing the Ext JS Class System and Tooling
Sencha Roadshow 2017: Modernizing the Ext JS Class System and ToolingSencha Roadshow 2017: Modernizing the Ext JS Class System and Tooling
Sencha Roadshow 2017: Modernizing the Ext JS Class System and ToolingSencha
 
Javascript first-class citizenery
Javascript first-class citizeneryJavascript first-class citizenery
Javascript first-class citizenerytoddbr
 
jQuery Proven Performance Tips & Tricks
jQuery Proven Performance Tips & TricksjQuery Proven Performance Tips & Tricks
jQuery Proven Performance Tips & TricksAddy Osmani
 
SenchaCon 2016: Learn the Top 10 Best ES2015 Features - Lee Boonstra
SenchaCon 2016: Learn the Top 10 Best ES2015 Features - Lee Boonstra  SenchaCon 2016: Learn the Top 10 Best ES2015 Features - Lee Boonstra
SenchaCon 2016: Learn the Top 10 Best ES2015 Features - Lee Boonstra Sencha
 
Laravel 로 ᄇᅹᄋᅟ는 á„‰á…„á„‡á…„á„‰á…Ąá„‹á…”á„ƒá…ł #5
Laravel 로 ᄇᅹᄋᅟ는 á„‰á…„á„‡á…„á„‰á…Ąá„‹á…”á„ƒá…ł #5Laravel 로 ᄇᅹᄋᅟ는 á„‰á…„á„‡á…„á„‰á…Ąá„‹á…”á„ƒá…ł #5
Laravel 로 ᄇᅹᄋᅟ는 á„‰á…„á„‡á…„á„‰á…Ąá„‹á…”á„ƒá…ł #5성음 한
 
Building a Backend with Flask
Building a Backend with FlaskBuilding a Backend with Flask
Building a Backend with FlaskMake School
 
Ext JS Architecture Best Practices - Mitchell Simeons
Ext JS Architecture Best Practices - Mitchell SimeonsExt JS Architecture Best Practices - Mitchell Simeons
Ext JS Architecture Best Practices - Mitchell SimeonsSencha
 
Learn about Eclipse e4 from Lars Vogel at SF-JUG
Learn about Eclipse e4 from Lars Vogel at SF-JUGLearn about Eclipse e4 from Lars Vogel at SF-JUG
Learn about Eclipse e4 from Lars Vogel at SF-JUGMarakana Inc.
 
[Bristol WordPress] Supercharging WordPress Development
[Bristol WordPress] Supercharging WordPress Development[Bristol WordPress] Supercharging WordPress Development
[Bristol WordPress] Supercharging WordPress DevelopmentAdam Tomat
 
Efficient Rails Test-Driven Development - Week 6
Efficient Rails Test-Driven Development - Week 6Efficient Rails Test-Driven Development - Week 6
Efficient Rails Test-Driven Development - Week 6Marakana Inc.
 
The Complementarity of React and Web Components
The Complementarity of React and Web ComponentsThe Complementarity of React and Web Components
The Complementarity of React and Web ComponentsAndrew Rota
 
Jquery Complete Presentation along with Javascript Basics
Jquery Complete Presentation along with Javascript BasicsJquery Complete Presentation along with Javascript Basics
Jquery Complete Presentation along with Javascript BasicsEPAM Systems
 
Introducing ExtReact: Adding Powerful Sencha Components to React Apps
Introducing ExtReact: Adding Powerful Sencha Components to React AppsIntroducing ExtReact: Adding Powerful Sencha Components to React Apps
Introducing ExtReact: Adding Powerful Sencha Components to React AppsSencha
 
AtlasCamp 2015: Using add-ons to build add-ons
AtlasCamp 2015: Using add-ons to build add-onsAtlasCamp 2015: Using add-ons to build add-ons
AtlasCamp 2015: Using add-ons to build add-onsAtlassian
 
Devoxx 2014-webComponents
Devoxx 2014-webComponentsDevoxx 2014-webComponents
Devoxx 2014-webComponentsCyril Balit
 
jQuery and Rails: Best Friends Forever
jQuery and Rails: Best Friends ForeverjQuery and Rails: Best Friends Forever
jQuery and Rails: Best Friends Foreverstephskardal
 
AtlasCamp 2015: Web technologies you should be using now
AtlasCamp 2015: Web technologies you should be using nowAtlasCamp 2015: Web technologies you should be using now
AtlasCamp 2015: Web technologies you should be using nowAtlassian
 

Mais procurados (20)

Webapps without the web
Webapps without the webWebapps without the web
Webapps without the web
 
Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd
Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd
Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd
 
SenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web Apps
SenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web AppsSenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web Apps
SenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web Apps
 
Sencha Roadshow 2017: Modernizing the Ext JS Class System and Tooling
Sencha Roadshow 2017: Modernizing the Ext JS Class System and ToolingSencha Roadshow 2017: Modernizing the Ext JS Class System and Tooling
Sencha Roadshow 2017: Modernizing the Ext JS Class System and Tooling
 
Javascript first-class citizenery
Javascript first-class citizeneryJavascript first-class citizenery
Javascript first-class citizenery
 
jQuery Proven Performance Tips & Tricks
jQuery Proven Performance Tips & TricksjQuery Proven Performance Tips & Tricks
jQuery Proven Performance Tips & Tricks
 
SenchaCon 2016: Learn the Top 10 Best ES2015 Features - Lee Boonstra
SenchaCon 2016: Learn the Top 10 Best ES2015 Features - Lee Boonstra  SenchaCon 2016: Learn the Top 10 Best ES2015 Features - Lee Boonstra
SenchaCon 2016: Learn the Top 10 Best ES2015 Features - Lee Boonstra
 
Laravel 로 ᄇᅹᄋᅟ는 á„‰á…„á„‡á…„á„‰á…Ąá„‹á…”á„ƒá…ł #5
Laravel 로 ᄇᅹᄋᅟ는 á„‰á…„á„‡á…„á„‰á…Ąá„‹á…”á„ƒá…ł #5Laravel 로 ᄇᅹᄋᅟ는 á„‰á…„á„‡á…„á„‰á…Ąá„‹á…”á„ƒá…ł #5
Laravel 로 ᄇᅹᄋᅟ는 á„‰á…„á„‡á…„á„‰á…Ąá„‹á…”á„ƒá…ł #5
 
Building a Backend with Flask
Building a Backend with FlaskBuilding a Backend with Flask
Building a Backend with Flask
 
Ext JS Architecture Best Practices - Mitchell Simeons
Ext JS Architecture Best Practices - Mitchell SimeonsExt JS Architecture Best Practices - Mitchell Simeons
Ext JS Architecture Best Practices - Mitchell Simeons
 
Learn about Eclipse e4 from Lars Vogel at SF-JUG
Learn about Eclipse e4 from Lars Vogel at SF-JUGLearn about Eclipse e4 from Lars Vogel at SF-JUG
Learn about Eclipse e4 from Lars Vogel at SF-JUG
 
[Bristol WordPress] Supercharging WordPress Development
[Bristol WordPress] Supercharging WordPress Development[Bristol WordPress] Supercharging WordPress Development
[Bristol WordPress] Supercharging WordPress Development
 
Efficient Rails Test-Driven Development - Week 6
Efficient Rails Test-Driven Development - Week 6Efficient Rails Test-Driven Development - Week 6
Efficient Rails Test-Driven Development - Week 6
 
The Complementarity of React and Web Components
The Complementarity of React and Web ComponentsThe Complementarity of React and Web Components
The Complementarity of React and Web Components
 
Jquery Complete Presentation along with Javascript Basics
Jquery Complete Presentation along with Javascript BasicsJquery Complete Presentation along with Javascript Basics
Jquery Complete Presentation along with Javascript Basics
 
Introducing ExtReact: Adding Powerful Sencha Components to React Apps
Introducing ExtReact: Adding Powerful Sencha Components to React AppsIntroducing ExtReact: Adding Powerful Sencha Components to React Apps
Introducing ExtReact: Adding Powerful Sencha Components to React Apps
 
AtlasCamp 2015: Using add-ons to build add-ons
AtlasCamp 2015: Using add-ons to build add-onsAtlasCamp 2015: Using add-ons to build add-ons
AtlasCamp 2015: Using add-ons to build add-ons
 
Devoxx 2014-webComponents
Devoxx 2014-webComponentsDevoxx 2014-webComponents
Devoxx 2014-webComponents
 
jQuery and Rails: Best Friends Forever
jQuery and Rails: Best Friends ForeverjQuery and Rails: Best Friends Forever
jQuery and Rails: Best Friends Forever
 
AtlasCamp 2015: Web technologies you should be using now
AtlasCamp 2015: Web technologies you should be using nowAtlasCamp 2015: Web technologies you should be using now
AtlasCamp 2015: Web technologies you should be using now
 

Semelhante a Codegnitorppt

Introduction To Code Igniter
Introduction To Code IgniterIntroduction To Code Igniter
Introduction To Code IgniterAmzad Hossain
 
CodeIgniter PHP MVC Framework
CodeIgniter PHP MVC FrameworkCodeIgniter PHP MVC Framework
CodeIgniter PHP MVC FrameworkBo-Yi Wu
 
Yii Introduction
Yii IntroductionYii Introduction
Yii IntroductionJason Ragsdale
 
Benefit of CodeIgniter php framework
Benefit of CodeIgniter php frameworkBenefit of CodeIgniter php framework
Benefit of CodeIgniter php frameworkBo-Yi Wu
 
Exploring Symfony's Code
Exploring Symfony's CodeExploring Symfony's Code
Exploring Symfony's CodeWildan Maulana
 
Refresh Austin - Intro to Dexy
Refresh Austin - Intro to DexyRefresh Austin - Intro to Dexy
Refresh Austin - Intro to Dexyananelson
 
Codeigniter
CodeigniterCodeigniter
CodeigniterShahRushika
 
Zend Framework 1.9 Setup & Using Zend_Tool
Zend Framework 1.9 Setup & Using Zend_ToolZend Framework 1.9 Setup & Using Zend_Tool
Zend Framework 1.9 Setup & Using Zend_ToolGordon Forsythe
 
Symfony2 - from the trenches
Symfony2 - from the trenchesSymfony2 - from the trenches
Symfony2 - from the trenchesLukas Smith
 
Intro to ColdBox MVC at Japan CFUG
Intro to ColdBox MVC at Japan CFUGIntro to ColdBox MVC at Japan CFUG
Intro to ColdBox MVC at Japan CFUGOrtus Solutions, Corp
 
Get things done with Yii - quickly build webapplications
Get things done with Yii - quickly build webapplicationsGet things done with Yii - quickly build webapplications
Get things done with Yii - quickly build webapplicationsGiuliano Iacobelli
 
Getting Started with Zend Framework
Getting Started with Zend FrameworkGetting Started with Zend Framework
Getting Started with Zend FrameworkJuan Antonio
 
Codebits 2012 - Fast relational web site construction.
Codebits 2012 - Fast relational web site construction.Codebits 2012 - Fast relational web site construction.
Codebits 2012 - Fast relational web site construction.Nelson Gomes
 
Spout - Building a RESTful web app with Angular.js and BEAR.Sunday
Spout - Building a RESTful web app with Angular.js and BEAR.SundaySpout - Building a RESTful web app with Angular.js and BEAR.Sunday
Spout - Building a RESTful web app with Angular.js and BEAR.SundayRichard McIntyre
 
Intro To Mvc Development In Php
Intro To Mvc Development In PhpIntro To Mvc Development In Php
Intro To Mvc Development In Phpfunkatron
 

Semelhante a Codegnitorppt (20)

Introduction To Code Igniter
Introduction To Code IgniterIntroduction To Code Igniter
Introduction To Code Igniter
 
Code Igniter 2
Code Igniter 2Code Igniter 2
Code Igniter 2
 
CodeIgniter PHP MVC Framework
CodeIgniter PHP MVC FrameworkCodeIgniter PHP MVC Framework
CodeIgniter PHP MVC Framework
 
Introduction To CodeIgniter
Introduction To CodeIgniterIntroduction To CodeIgniter
Introduction To CodeIgniter
 
WebGUI Developers Workshop
WebGUI Developers WorkshopWebGUI Developers Workshop
WebGUI Developers Workshop
 
Yii Introduction
Yii IntroductionYii Introduction
Yii Introduction
 
Play!ng with scala
Play!ng with scalaPlay!ng with scala
Play!ng with scala
 
Intro to Laravel 4
Intro to Laravel 4Intro to Laravel 4
Intro to Laravel 4
 
Benefit of CodeIgniter php framework
Benefit of CodeIgniter php frameworkBenefit of CodeIgniter php framework
Benefit of CodeIgniter php framework
 
Exploring Symfony's Code
Exploring Symfony's CodeExploring Symfony's Code
Exploring Symfony's Code
 
Refresh Austin - Intro to Dexy
Refresh Austin - Intro to DexyRefresh Austin - Intro to Dexy
Refresh Austin - Intro to Dexy
 
Codeigniter
CodeigniterCodeigniter
Codeigniter
 
Zend Framework 1.9 Setup & Using Zend_Tool
Zend Framework 1.9 Setup & Using Zend_ToolZend Framework 1.9 Setup & Using Zend_Tool
Zend Framework 1.9 Setup & Using Zend_Tool
 
Symfony2 - from the trenches
Symfony2 - from the trenchesSymfony2 - from the trenches
Symfony2 - from the trenches
 
Intro to ColdBox MVC at Japan CFUG
Intro to ColdBox MVC at Japan CFUGIntro to ColdBox MVC at Japan CFUG
Intro to ColdBox MVC at Japan CFUG
 
Get things done with Yii - quickly build webapplications
Get things done with Yii - quickly build webapplicationsGet things done with Yii - quickly build webapplications
Get things done with Yii - quickly build webapplications
 
Getting Started with Zend Framework
Getting Started with Zend FrameworkGetting Started with Zend Framework
Getting Started with Zend Framework
 
Codebits 2012 - Fast relational web site construction.
Codebits 2012 - Fast relational web site construction.Codebits 2012 - Fast relational web site construction.
Codebits 2012 - Fast relational web site construction.
 
Spout - Building a RESTful web app with Angular.js and BEAR.Sunday
Spout - Building a RESTful web app with Angular.js and BEAR.SundaySpout - Building a RESTful web app with Angular.js and BEAR.Sunday
Spout - Building a RESTful web app with Angular.js and BEAR.Sunday
 
Intro To Mvc Development In Php
Intro To Mvc Development In PhpIntro To Mvc Development In Php
Intro To Mvc Development In Php
 

Último

Kala jadu for love marriage | Real amil baba | Famous amil baba | kala jadu n...
Kala jadu for love marriage | Real amil baba | Famous amil baba | kala jadu n...Kala jadu for love marriage | Real amil baba | Famous amil baba | kala jadu n...
Kala jadu for love marriage | Real amil baba | Famous amil baba | kala jadu n...babafaisel
 
Call Girls Basavanagudi Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
Call Girls Basavanagudi Just Call 👗 7737669865 👗 Top Class Call Girl Service ...Call Girls Basavanagudi Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
Call Girls Basavanagudi Just Call 👗 7737669865 👗 Top Class Call Girl Service ...amitlee9823
 
Call Girls in Kalkaji Delhi 8264348440 call girls ❀
Call Girls in Kalkaji Delhi 8264348440 call girls ❀Call Girls in Kalkaji Delhi 8264348440 call girls ❀
Call Girls in Kalkaji Delhi 8264348440 call girls ❀soniya singh
 
đŸ’«âœ…jodhpur 24×7 BEST GENUINE PERSON LOW PRICE CALL GIRL SERVICE FULL SATISFACT...
đŸ’«âœ…jodhpur 24×7 BEST GENUINE PERSON LOW PRICE CALL GIRL SERVICE FULL SATISFACT...đŸ’«âœ…jodhpur 24×7 BEST GENUINE PERSON LOW PRICE CALL GIRL SERVICE FULL SATISFACT...
đŸ’«âœ…jodhpur 24×7 BEST GENUINE PERSON LOW PRICE CALL GIRL SERVICE FULL SATISFACT...sonalitrivedi431
 
RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...amitlee9823
 
The_Canvas_of_Creative_Mastery_Newsletter_April_2024_Version.pdf
The_Canvas_of_Creative_Mastery_Newsletter_April_2024_Version.pdfThe_Canvas_of_Creative_Mastery_Newsletter_April_2024_Version.pdf
The_Canvas_of_Creative_Mastery_Newsletter_April_2024_Version.pdfAmirYakdi
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756dollysharma2066
 
Verified Trusted Call Girls Adugodi💘 9352852248 Good Looking standard Profil...
Verified Trusted Call Girls Adugodi💘 9352852248  Good Looking standard Profil...Verified Trusted Call Girls Adugodi💘 9352852248  Good Looking standard Profil...
Verified Trusted Call Girls Adugodi💘 9352852248 Good Looking standard Profil...kumaririma588
 
DragonBall PowerPoint Template for demo.pptx
DragonBall PowerPoint Template for demo.pptxDragonBall PowerPoint Template for demo.pptx
DragonBall PowerPoint Template for demo.pptxmirandajeremy200221
 
Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...amitlee9823
 
Design Inspiration for College by Slidesgo.pptx
Design Inspiration for College by Slidesgo.pptxDesign Inspiration for College by Slidesgo.pptx
Design Inspiration for College by Slidesgo.pptxTusharBahuguna2
 
call girls in Kaushambi (Ghaziabad) 🔝 >àŒ’8448380779 🔝 genuine Escort Service 🔝...
call girls in Kaushambi (Ghaziabad) 🔝 >àŒ’8448380779 🔝 genuine Escort Service 🔝...call girls in Kaushambi (Ghaziabad) 🔝 >àŒ’8448380779 🔝 genuine Escort Service 🔝...
call girls in Kaushambi (Ghaziabad) 🔝 >àŒ’8448380779 🔝 genuine Escort Service 🔝...Delhi Call girls
 
Jigani Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...
Jigani Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...Jigani Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...
Jigani Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...amitlee9823
 
The history of music videos a level presentation
The history of music videos a level presentationThe history of music videos a level presentation
The history of music videos a level presentationamedia6
 
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...home
 
SD_The MATATAG Curriculum Training Design.pptx
SD_The MATATAG Curriculum Training Design.pptxSD_The MATATAG Curriculum Training Design.pptx
SD_The MATATAG Curriculum Training Design.pptxjanettecruzeiro1
 
Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Gi...
Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Gi...Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Gi...
Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Gi...Pooja Nehwal
 
Top Rated Pune Call Girls Koregaon Park ⟟ 6297143586 ⟟ Call Me For Genuine S...
Top Rated  Pune Call Girls Koregaon Park ⟟ 6297143586 ⟟ Call Me For Genuine S...Top Rated  Pune Call Girls Koregaon Park ⟟ 6297143586 ⟟ Call Me For Genuine S...
Top Rated Pune Call Girls Koregaon Park ⟟ 6297143586 ⟟ Call Me For Genuine S...Call Girls in Nagpur High Profile
 
VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...
VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...
VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...Call Girls in Nagpur High Profile
 

Último (20)

Kala jadu for love marriage | Real amil baba | Famous amil baba | kala jadu n...
Kala jadu for love marriage | Real amil baba | Famous amil baba | kala jadu n...Kala jadu for love marriage | Real amil baba | Famous amil baba | kala jadu n...
Kala jadu for love marriage | Real amil baba | Famous amil baba | kala jadu n...
 
Call Girls Basavanagudi Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
Call Girls Basavanagudi Just Call 👗 7737669865 👗 Top Class Call Girl Service ...Call Girls Basavanagudi Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
Call Girls Basavanagudi Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
 
Call Girls in Kalkaji Delhi 8264348440 call girls ❀
Call Girls in Kalkaji Delhi 8264348440 call girls ❀Call Girls in Kalkaji Delhi 8264348440 call girls ❀
Call Girls in Kalkaji Delhi 8264348440 call girls ❀
 
đŸ’«âœ…jodhpur 24×7 BEST GENUINE PERSON LOW PRICE CALL GIRL SERVICE FULL SATISFACT...
đŸ’«âœ…jodhpur 24×7 BEST GENUINE PERSON LOW PRICE CALL GIRL SERVICE FULL SATISFACT...đŸ’«âœ…jodhpur 24×7 BEST GENUINE PERSON LOW PRICE CALL GIRL SERVICE FULL SATISFACT...
đŸ’«âœ…jodhpur 24×7 BEST GENUINE PERSON LOW PRICE CALL GIRL SERVICE FULL SATISFACT...
 
RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
 
The_Canvas_of_Creative_Mastery_Newsletter_April_2024_Version.pdf
The_Canvas_of_Creative_Mastery_Newsletter_April_2024_Version.pdfThe_Canvas_of_Creative_Mastery_Newsletter_April_2024_Version.pdf
The_Canvas_of_Creative_Mastery_Newsletter_April_2024_Version.pdf
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
B. Smith. (Architectural Portfolio.).pdf
B. Smith. (Architectural Portfolio.).pdfB. Smith. (Architectural Portfolio.).pdf
B. Smith. (Architectural Portfolio.).pdf
 
Verified Trusted Call Girls Adugodi💘 9352852248 Good Looking standard Profil...
Verified Trusted Call Girls Adugodi💘 9352852248  Good Looking standard Profil...Verified Trusted Call Girls Adugodi💘 9352852248  Good Looking standard Profil...
Verified Trusted Call Girls Adugodi💘 9352852248 Good Looking standard Profil...
 
DragonBall PowerPoint Template for demo.pptx
DragonBall PowerPoint Template for demo.pptxDragonBall PowerPoint Template for demo.pptx
DragonBall PowerPoint Template for demo.pptx
 
Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
 
Design Inspiration for College by Slidesgo.pptx
Design Inspiration for College by Slidesgo.pptxDesign Inspiration for College by Slidesgo.pptx
Design Inspiration for College by Slidesgo.pptx
 
call girls in Kaushambi (Ghaziabad) 🔝 >àŒ’8448380779 🔝 genuine Escort Service 🔝...
call girls in Kaushambi (Ghaziabad) 🔝 >àŒ’8448380779 🔝 genuine Escort Service 🔝...call girls in Kaushambi (Ghaziabad) 🔝 >àŒ’8448380779 🔝 genuine Escort Service 🔝...
call girls in Kaushambi (Ghaziabad) 🔝 >àŒ’8448380779 🔝 genuine Escort Service 🔝...
 
Jigani Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...
Jigani Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...Jigani Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...
Jigani Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...
 
The history of music videos a level presentation
The history of music videos a level presentationThe history of music videos a level presentation
The history of music videos a level presentation
 
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...
 
SD_The MATATAG Curriculum Training Design.pptx
SD_The MATATAG Curriculum Training Design.pptxSD_The MATATAG Curriculum Training Design.pptx
SD_The MATATAG Curriculum Training Design.pptx
 
Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Gi...
Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Gi...Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Gi...
Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Gi...
 
Top Rated Pune Call Girls Koregaon Park ⟟ 6297143586 ⟟ Call Me For Genuine S...
Top Rated  Pune Call Girls Koregaon Park ⟟ 6297143586 ⟟ Call Me For Genuine S...Top Rated  Pune Call Girls Koregaon Park ⟟ 6297143586 ⟟ Call Me For Genuine S...
Top Rated Pune Call Girls Koregaon Park ⟟ 6297143586 ⟟ Call Me For Genuine S...
 
VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...
VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...
VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...
 

Codegnitorppt

  • 1. Submitted By Reshma vijayan .R
  • 2.  Introduction  Why Framework not Scratch?  MVC ( Model View Controller) Architecture  What is CodeIgniter ????  Application Flow of CodeIgniter  CodeIgniter URL  Controllers  Views  Models  CRUD operations  Session starting  Form validation  Q/A  Reference
  • 3.  Key Factors of a Development  Interface Design  Business Logic  Database Manipulation  Advantage of Framework  Provide Solutions to Common problems  Abstract Levels of functionality  Make Rapid Development Easier  Disadvantage of Scratch Development  Make your own Abstract Layer  Solve Common Problems Yourself  The more Typing Speed the more faster
  • 4.  Separates User Interface From Business Logic  Model - Encapsulates core application data and functionality Business Logic.  View - obtains data from the model and presents it to the user.  Controller - receives and translates input to requests on the model or the view Figure : 01
  • 5.  An Open Source Web Application Framework  Nearly Zero Configuration  MVC ( Model View Controller ) Architecture  Multiple DB (Database) support  Caching  Modules  Validation  Rich Sets of Libraries for Commonly Needed Tasks  Has a Clear, Thorough documentation
  • 6. Figure : 2 [ Application Flow of CodeIgniter]
  • 7. URL in CodeIgniter is Segment Based. www.your-site.com/news/article/my_article Segments in a URI www.your-site.com/class/function/ID CodeIgniter Optionally Supports Query String URL www.your-site.com/index.php?c=news&m=article&ID=345
  • 8. A Class file resides under “application/controllers” www.your-site.com/index.php/first <?php class First extends CI_Controller{ function First() { parent::Controller(); } function index() { echo “<h1> Hello CUET !! </h1> “; } } ?> // Output Will be “Hello CUET!!” ‱ Note: ‱ Class names must start with an Uppercase Letter. ‱ In case of “constructor” you must use “parent::Controller();”
  • 9. In This Particular Code www.your-site.com/index.php/first/bdosdn/world <?php class First extends Controller{ function index() { echo “<h1> Hello CUET !! </h1> “; } function bdosdn( $location ) { echo “<h2> Hello $location !! </h2>”; } } ?> // Output Will be “Hello world !!” ‱ Note: ‱ The ‘Index’ Function always loads by default. Unless there is a second segment in the URL
  • 10.  A Webpage or A page Fragment  Should be placed under “application/views”  Never Called Directly 10 web_root/myci/system/application/views/myview.php <html> <title> My First CodeIgniter Project</title> <body> <h1> Welcome ALL 
 To My .. ::: First Project ::: . . . </h1> </body> </html>
  • 11. Calling a VIEW from Controller $this->load->view(‘myview’); Data Passing to a VIEW from Controller function index() { $var = array( ‘full_name’ => ‘Amzad Hossain’, ‘email’ => ‘tohi1000@yahoo.com’ ); $this->load->view(‘myview’, $var); } <html> <title> ..::Personal Info::.. </title> <body> Full Name : <?php echo $full_name;?> <br /> E-mail : <?=email;?> <br /> </body> </html>
  • 12. Designed to work with Information of Database Models Should be placed Under “application/models/” <?php class Mymodel extend Model{ function Mymodel() { parent::Model(); } function get_info() { $query = $this->db->get(‘name’, 10); /*Using ActiveRecord*/ return $query->result(); } } ?> Loading a Model inside a Controller $this->load->model(‘mymodel’); $data = $this->mymodel->get_info();
  • 13. CRUD OPERATIONS IN MVC ➱Create ➱Read ➱Update ➱Delete
  • 14. DATABASE CREATION //Create CREATE TABLE `user` ( `id` INT( 50 ) NOT NULL AUTO_INCREMENT , `username` VARCHAR( 50 ) NOT NULL , `email` VARCHAR( 100 ) NOT NULL , `password` VARCHAR( 255 ) NOT NULL , PRIMARY KEY ( `id` ) )
  • 15. DATABASE CONFIGURATION Open application/config/database.php $config['hostname'] = "localhost"; $config['username'] = "root"; $config['password'] = ""; $config['database'] = "mydatabase"; $config['dbdriver'] = "mysql";
  • 16. CONFIGURATION Then open application/config/config.php $config['base_url'] = 'http://localhost/ci_user'; Open application/config/autoload.php $autoload['libraries'] = array('session','database'); $autoload['helper'] = array('url','form'); Open application/config/routes.php, change default controller to user controller
  • 17. Creating our view page Create a blank document in the views file (application -> views) and name it Registration.php /Login.php Using HTML and CSS create a simple registration form
  • 18. public function add_user() { $data=array ( 'FirstName' => $this->input- >post('firstname'), 'LastName'=>$this->input- >post('lastname'), 'Gender'=>$this->input->post('gender'), 'UserName'=>$this->input- >post('username'), 'EmailId'=>$this->input->post('email'), 'Password'=>$this->input- >post('password')); $this->db->insert('user',$data); }
  • 19. //select public function doLogin($username, $password) { $q = "SELECT * FROM representative WHERE UserName= '$username' AND Password = '$password'"; $query = $this->db->query($q); if($query->num_rows()>0) { foreach($query->result() as $rows) { //add all data to session $newdata = array('user_id' => $rows- >Id,'username' => $rows->UserName,'email' => $rows- >EmailId,'logged_in' => TRUE); } $this->session->set_userdata($newdata); return true; } return false; }
  • 20. //Update $this->load->db(); $this->db->update('tablename',$data); $this->db->where('id',$id); //delete $this->load->db(); $this->db->delete('tablename',$data); $this->db->where('id',$id);
  • 21. SESSION STARTING <?php Session start(); $_session['id']=$id; $_session['username']=$username; $_session['login true']='valid'; if($-session['login true']=='valid') { $this->load->view('profile.php'); } else { $this->load->view('login.php'); }
  • 22. FORM VALIDATION public function registration() { $this->load->library('form_validation'); // field name, error message, validation rules $this->form_validation->set_rules('firstname', 'First Name', 'trim|required|min_length[3]|xss_clean'); $this->form_validation->set_rules('lastname', 'Last Name', 'trim|required|min_length[1]|xss_clean'); $this->form_validation->set_rules('username', 'User Name','trim|required|min_length[4]|xss_clean| is_unique[user.UserName]'); }
  • 23. if($this->form_validation->run() == FALSE) { $this->load->view('Register_form'); } else { $this->load->model('db_model'); $this->db_model->add_user(); }
  • 24. USEFUL LINKS  www.codeigniter.com
  • 25.  User Guide of CodeIgniter  Wikipedia  Slideshare