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

PPT
Code igniter overview
PDF
MVC with Zend Framework
PDF
Building Web Applications with Zend Framework
PPTX
Zend MVC pattern based Framework – Best for Enterprise web applications
PPTX
PHP Frameworks & Introduction to CodeIgniter
PPTX
What to Expect from Sahi Pro
PPTX
How to build a JavaScript toolkit
PDF
Codeigniter Training Part3
Code igniter overview
MVC with Zend Framework
Building Web Applications with Zend Framework
Zend MVC pattern based Framework – Best for Enterprise web applications
PHP Frameworks & Introduction to CodeIgniter
What to Expect from Sahi Pro
How to build a JavaScript toolkit
Codeigniter Training Part3

Viewers also liked (15)

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

Similar to CodeIgniter Practice (20)

PPTX
CodeIgniter & MVC
PPTX
Managing Applications in CodeIgniter
PDF
Codeigniter
PPTX
CodeIgniter 101 Tutorial
PDF
CodeIgniter For Project : Lesson 103 - Introduction to Codeigniter
PPTX
Codeigniter
PPT
Introduction To CodeIgniter
PPT
Codeigniter
DOCX
Codeigniter
PDF
A Guide to CodeIgniter Web Application Development.pdf
PDF
CodeIgniter Website Development a Comprehensive Guide 2024 .pdf
PDF
Codeigniter For Rapid Php Application Development 1st Edition David Upton
PPT
Benefits of the CodeIgniter Framework
PPT
Codeigniter simple explanation
PPTX
Introduction to codeigniter
DOCX
Get Codeigniter Developement Services From Us
PPTX
Code Igniter Security
PDF
Code igniter - A brief introduction
PPT
Introduction To Code Igniter
PPTX
Seminar.pptx
CodeIgniter & MVC
Managing Applications in CodeIgniter
Codeigniter
CodeIgniter 101 Tutorial
CodeIgniter For Project : Lesson 103 - Introduction to Codeigniter
Codeigniter
Introduction To CodeIgniter
Codeigniter
Codeigniter
A Guide to CodeIgniter Web Application Development.pdf
CodeIgniter Website Development a Comprehensive Guide 2024 .pdf
Codeigniter For Rapid Php Application Development 1st Edition David Upton
Benefits of the CodeIgniter Framework
Codeigniter simple explanation
Introduction to codeigniter
Get Codeigniter Developement Services From Us
Code Igniter Security
Code igniter - A brief introduction
Introduction To Code Igniter
Seminar.pptx
Ad

More from Jamshid Hashimi (20)

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

Recently uploaded (20)

PPTX
Big Data Technologies - Introduction.pptx
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
cuic standard and advanced reporting.pdf
PDF
Encapsulation theory and applications.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
Cloud computing and distributed systems.
PPT
Teaching material agriculture food technology
PDF
KodekX | Application Modernization Development
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Encapsulation_ Review paper, used for researhc scholars
Big Data Technologies - Introduction.pptx
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
cuic standard and advanced reporting.pdf
Encapsulation theory and applications.pdf
Unlocking AI with Model Context Protocol (MCP)
Network Security Unit 5.pdf for BCA BBA.
Dropbox Q2 2025 Financial Results & Investor Presentation
Digital-Transformation-Roadmap-for-Companies.pptx
Cloud computing and distributed systems.
Teaching material agriculture food technology
KodekX | Application Modernization Development
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Review of recent advances in non-invasive hemoglobin estimation
sap open course for s4hana steps from ECC to s4
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
20250228 LYD VKU AI Blended-Learning.pptx
NewMind AI Weekly Chronicles - August'25 Week I
Diabetes mellitus diagnosis method based random forest with bat algorithm
Encapsulation_ Review paper, used for researhc scholars

CodeIgniter Practice

  • 1. CodeIgniter Practice Jamshid Hashimi Trainer, Cresco Solution http://www.jamshidhashimi.com jamshid@netlinks.af @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