SlideShare a Scribd company logo
CodeIgniter Practice
Jamshid Hashimi
Trainer, Cresco Solution
http://www.jamshidhashimi.com
jamshid@netlinks.af
@jamshidhashimi
ajamshidhashimi
Afghanistan Workforce
Development Program
Agenda
• Create an Application with CodeIgniter
• Common Functions
• URI Routing
• Error Handling
• Caching
• Profiling CodeIgniter Application
Create an Application with CodeIgniter
• Controllers
– Functions
• Views
– Template folder
• Helpers
– Handling tempaltes
• Libraries
DEMO
Common Functions
• CodeIgniter uses a few functions for its operation that
are globally defined, and are available to you at any
point. These do not require loading any libraries or
helpers.
– is_php('version_number')
– is_really_writable('path/to/file')
– config_item('item_key')
– show_error('message')
– show_404('page')
– log_message('level', 'message')
• error
• debug
• Info
DEMO
URI Routing
• Typically there is a one-to-one relationship
between a URL string and its corresponding
controller class/method.
$route['journals'] = "blogs";
$route['blog/joe'] = "blogs/users/34";
$route['product/(:any)'] = "catalog/product_lookup";
$route['product/(:num)'] = "catalog/product_lookup_by_id/$1”;
DEMO
Error Handling
• CodeIgniter lets you build error reporting into
your applications using the functions described
below. In addition, it has an error logging class
that permits error and debugging messages to be
saved as text files.
– show_error('message' [, int $status_code= 500 ] )
– show_404('page' [, 'log_error'])
– log_message('level', 'message')
• error
• debug
• Info
Caching
• CodeIgniter lets you cache your pages in order
to achieve maximum performance.
$this->output->cache(n);
DEMO
Profiling CodeIgniter Application
• The Profiler Class will display benchmark
results, queries you have run, and $_POST
data at the bottom of your pages. This
information can be useful during development
in order to help with debugging and
optimization.
$this->output->enable_profiler(TRUE);
Profiling CodeIgniter Application
• Each section of Profiler data can be enabled or
disabled by setting a corresponding config
variable to TRUE or FALSE.
• Override in Controller
$config['config'] = FALSE;
$config['queries'] = FALSE;
$sections = array(
'config' => TRUE,
'queries' => TRUE
);
$this->output->set_profiler_sections($sections);
DEMO
QUESTIONS?

More Related Content

Viewers also liked (15)

PDF
Web app development_php_06
Hassen Poreya
 
PDF
Web app development_database_design_10
Hassen Poreya
 
PDF
Web app development_php_05
Hassen Poreya
 
PDF
Web app development_my_sql_09
Hassen Poreya
 
PDF
Web app development_php_04
Hassen Poreya
 
PPTX
Learn to Code with JavaScript - Choose Your Own Adventures
Tessa Mero
 
PDF
Web app development_database_design_11
Hassen Poreya
 
PDF
Web app development_crud_13
Hassen Poreya
 
PDF
Web app development_database_design_er-mapping_12
Hassen Poreya
 
PDF
Web app development_html_css_03
Hassen Poreya
 
PDF
Web app development_my_sql_08
Hassen Poreya
 
PDF
Web app development_php_07
Hassen Poreya
 
PDF
Web app development_html_02
Hassen Poreya
 
PDF
Web app development_html_01
Hassen Poreya
 
PDF
Web app development_cookies_sessions_14
Hassen Poreya
 
Web app development_php_06
Hassen Poreya
 
Web app development_database_design_10
Hassen Poreya
 
Web app development_php_05
Hassen Poreya
 
Web app development_my_sql_09
Hassen Poreya
 
Web app development_php_04
Hassen Poreya
 
Learn to Code with JavaScript - Choose Your Own Adventures
Tessa Mero
 
Web app development_database_design_11
Hassen Poreya
 
Web app development_crud_13
Hassen Poreya
 
Web app development_database_design_er-mapping_12
Hassen Poreya
 
Web app development_html_css_03
Hassen Poreya
 
Web app development_my_sql_08
Hassen Poreya
 
Web app development_php_07
Hassen Poreya
 
Web app development_html_02
Hassen Poreya
 
Web app development_html_01
Hassen Poreya
 
Web app development_cookies_sessions_14
Hassen Poreya
 

Similar to CodeIgniter Practice (20)

PPTX
CodeIgniter & MVC
Jamshid Hashimi
 
PPTX
Managing Applications in CodeIgniter
Jamshid Hashimi
 
PDF
Codeigniter
EmmanuelMasyenene1
 
PPTX
CodeIgniter 101 Tutorial
Konstantinos Magarisiotis
 
PDF
CodeIgniter For Project : Lesson 103 - Introduction to Codeigniter
Weerayut Hongsa
 
PPTX
Codeigniter
ShahRushika
 
PPT
Introduction To CodeIgniter
schwebbie
 
PPT
Codeigniter
minhrau111
 
DOCX
Codeigniter
Chirag Parmar
 
PDF
A Guide to CodeIgniter Web Application Development.pdf
UmanoLogic
 
PDF
CodeIgniter Website Development a Comprehensive Guide 2024 .pdf
JPLoft Solutions
 
PDF
Codeigniter For Rapid Php Application Development 1st Edition David Upton
ikelqueezy
 
PPT
Benefits of the CodeIgniter Framework
Toby Beresford
 
PPT
Codeigniter simple explanation
Arumugam P
 
PPTX
Introduction to codeigniter
Harishankaran K
 
DOCX
Get Codeigniter Developement Services From Us
Joe_Mason
 
PPTX
Code Igniter Security
serezawa
 
PDF
Code igniter - A brief introduction
Commit University
 
PPT
Introduction To Code Igniter
Amzad Hossain
 
PPTX
Seminar.pptx
Akshay Bhujbal
 
CodeIgniter & MVC
Jamshid Hashimi
 
Managing Applications in CodeIgniter
Jamshid Hashimi
 
Codeigniter
EmmanuelMasyenene1
 
CodeIgniter 101 Tutorial
Konstantinos Magarisiotis
 
CodeIgniter For Project : Lesson 103 - Introduction to Codeigniter
Weerayut Hongsa
 
Codeigniter
ShahRushika
 
Introduction To CodeIgniter
schwebbie
 
Codeigniter
minhrau111
 
Codeigniter
Chirag Parmar
 
A Guide to CodeIgniter Web Application Development.pdf
UmanoLogic
 
CodeIgniter Website Development a Comprehensive Guide 2024 .pdf
JPLoft Solutions
 
Codeigniter For Rapid Php Application Development 1st Edition David Upton
ikelqueezy
 
Benefits of the CodeIgniter Framework
Toby Beresford
 
Codeigniter simple explanation
Arumugam P
 
Introduction to codeigniter
Harishankaran K
 
Get Codeigniter Developement Services From Us
Joe_Mason
 
Code Igniter Security
serezawa
 
Code igniter - A brief introduction
Commit University
 
Introduction To Code Igniter
Amzad Hossain
 
Seminar.pptx
Akshay Bhujbal
 
Ad

More from Jamshid Hashimi (20)

PPTX
Week 2: Getting Your Hands Dirty – Part 2
Jamshid Hashimi
 
PPTX
Week 1: Getting Your Hands Dirty - Part 1
Jamshid Hashimi
 
PPTX
Introduction to C# - Week 0
Jamshid Hashimi
 
PPTX
RIST - Research Institute for Science and Technology
Jamshid Hashimi
 
PPTX
How Coding Can Make Your Life Better
Jamshid Hashimi
 
PPTX
Mobile Vision
Jamshid Hashimi
 
PPTX
Tips for Writing Better Code
Jamshid Hashimi
 
PPTX
Launch Your Local Blog & Social Media Integration
Jamshid Hashimi
 
PPTX
Customizing Your Blog 2
Jamshid Hashimi
 
PPTX
Customizing Your Blog 1
Jamshid Hashimi
 
PPTX
Introduction to Blogging
Jamshid Hashimi
 
PPTX
Introduction to Wordpress
Jamshid Hashimi
 
PPTX
CodeIgniter Helper Functions
Jamshid Hashimi
 
PPTX
CodeIgniter Class Reference
Jamshid Hashimi
 
PPTX
Exception & Database
Jamshid Hashimi
 
PPTX
MySQL Record Operations
Jamshid Hashimi
 
PPTX
MySQL JOIN & UNION
Jamshid Hashimi
 
PPTX
MySQL basics
Jamshid Hashimi
 
PPTX
Php file upload, cookies & session
Jamshid Hashimi
 
PPTX
Php File Operations
Jamshid Hashimi
 
Week 2: Getting Your Hands Dirty – Part 2
Jamshid Hashimi
 
Week 1: Getting Your Hands Dirty - Part 1
Jamshid Hashimi
 
Introduction to C# - Week 0
Jamshid Hashimi
 
RIST - Research Institute for Science and Technology
Jamshid Hashimi
 
How Coding Can Make Your Life Better
Jamshid Hashimi
 
Mobile Vision
Jamshid Hashimi
 
Tips for Writing Better Code
Jamshid Hashimi
 
Launch Your Local Blog & Social Media Integration
Jamshid Hashimi
 
Customizing Your Blog 2
Jamshid Hashimi
 
Customizing Your Blog 1
Jamshid Hashimi
 
Introduction to Blogging
Jamshid Hashimi
 
Introduction to Wordpress
Jamshid Hashimi
 
CodeIgniter Helper Functions
Jamshid Hashimi
 
CodeIgniter Class Reference
Jamshid Hashimi
 
Exception & Database
Jamshid Hashimi
 
MySQL Record Operations
Jamshid Hashimi
 
MySQL JOIN & UNION
Jamshid Hashimi
 
MySQL basics
Jamshid Hashimi
 
Php file upload, cookies & session
Jamshid Hashimi
 
Php File Operations
Jamshid Hashimi
 
Ad

Recently uploaded (20)

PDF
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
PPTX
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PDF
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
PDF
Kit-Works Team Study_20250627_한달만에만든사내서비스키링(양다윗).pdf
Wonjun Hwang
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
PPT
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
PDF
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
DOCX
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PDF
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PPTX
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
PDF
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
PPTX
Digital Circuits, important subject in CS
contactparinay1
 
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
Kit-Works Team Study_20250627_한달만에만든사내서비스키링(양다윗).pdf
Wonjun Hwang
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
Digital Circuits, important subject in CS
contactparinay1
 

CodeIgniter Practice

  • 1. CodeIgniter Practice Jamshid Hashimi Trainer, Cresco Solution http://www.jamshidhashimi.com [email protected] @jamshidhashimi ajamshidhashimi Afghanistan Workforce Development Program
  • 2. Agenda • Create an Application with CodeIgniter • Common Functions • URI Routing • Error Handling • Caching • Profiling CodeIgniter Application
  • 3. Create an Application with CodeIgniter • Controllers – Functions • Views – Template folder • Helpers – Handling tempaltes • Libraries
  • 5. Common Functions • CodeIgniter uses a few functions for its operation that are globally defined, and are available to you at any point. These do not require loading any libraries or helpers. – is_php('version_number') – is_really_writable('path/to/file') – config_item('item_key') – show_error('message') – show_404('page') – log_message('level', 'message') • error • debug • Info
  • 7. URI Routing • Typically there is a one-to-one relationship between a URL string and its corresponding controller class/method. $route['journals'] = "blogs"; $route['blog/joe'] = "blogs/users/34"; $route['product/(:any)'] = "catalog/product_lookup"; $route['product/(:num)'] = "catalog/product_lookup_by_id/$1”;
  • 9. Error Handling • CodeIgniter lets you build error reporting into your applications using the functions described below. In addition, it has an error logging class that permits error and debugging messages to be saved as text files. – show_error('message' [, int $status_code= 500 ] ) – show_404('page' [, 'log_error']) – log_message('level', 'message') • error • debug • Info
  • 10. Caching • CodeIgniter lets you cache your pages in order to achieve maximum performance. $this->output->cache(n);
  • 11. DEMO
  • 12. Profiling CodeIgniter Application • The Profiler Class will display benchmark results, queries you have run, and $_POST data at the bottom of your pages. This information can be useful during development in order to help with debugging and optimization. $this->output->enable_profiler(TRUE);
  • 13. Profiling CodeIgniter Application • Each section of Profiler data can be enabled or disabled by setting a corresponding config variable to TRUE or FALSE. • Override in Controller $config['config'] = FALSE; $config['queries'] = FALSE; $sections = array( 'config' => TRUE, 'queries' => TRUE ); $this->output->set_profiler_sections($sections);
  • 14. DEMO