SlideShare a Scribd company logo
CodeIgniter For ProjectLesson 105 : Helper and Library
Weerayut Hongsa : Network Engineer / Software Developer
Major Kantana Broadcasting Co., Ltd
https://kusumotolab.com
Helper
“Helpers, as the name suggests, help you with tasks. Each
helper file is simply a collection of functions in a particular
category”
Weerayut Hongsa : Network Engineer / Software Developer
Major Kantana Broadcasting Co., Ltd
https://kusumotolab.com
Helper load code
• $this->load->helper([helper name]);
Weerayut Hongsa : Network Engineer / Software Developer
Major Kantana Broadcasting Co., Ltd
https://kusumotolab.com
You can load helper on constructor and function in Controller
Helper frequently used
• url : URL helper utility
• form : Form helper utility
Weerayut Hongsa : Network Engineer / Software Developer
Major Kantana Broadcasting Co., Ltd
https://kusumotolab.com
url : URL helper utility
• site_url() : Get current url your website.
• base_url() : Get current base path.
Weerayut Hongsa : Network Engineer / Software Developer
Major Kantana Broadcasting Co., Ltd
https://kusumotolab.com
url : URL helper utility
• base_url()
Weerayut Hongsa : Network Engineer / Software Developer
Major Kantana Broadcasting Co., Ltd
https://kusumotolab.com
url : URL helper utility
• site_url()
Weerayut Hongsa : Network Engineer / Software Developer
Major Kantana Broadcasting Co., Ltd
https://kusumotolab.com
form : Form helper utility
• form_open() : Auto form open generate
• form_close() : Auto form close generate
Weerayut Hongsa : Network Engineer / Software Developer
Major Kantana Broadcasting Co., Ltd
https://kusumotolab.com
form : Form helper utility
• form_open()
• form_close()
Weerayut Hongsa : Network Engineer / Software Developer
Major Kantana Broadcasting Co., Ltd
https://kusumotolab.com
Library
Weerayut Hongsa : Network Engineer / Software Developer
Major Kantana Broadcasting Co., Ltd
https://kusumotolab.com
Library load code
• $this->load->library([library name]);
Weerayut Hongsa : Network Engineer / Software Developer
Major Kantana Broadcasting Co., Ltd
https://kusumotolab.com
You can load library on constructor and function in Controller
Library frequently used
• session : CodeIgniter session library
• input : CodeIgniter input library (autoload)
• load : CodeIgniter library loader (autoload)
• form_validation : CodeIgniter form validate library
Weerayut Hongsa : Network Engineer / Software Developer
Major Kantana Broadcasting Co., Ltd
https://kusumotolab.com
session : CodeIgniter session library
• $this->session->set_userdata() : Set user data session
• $this->session->unset_userdata() : Unset user data session
• $this->session->userdata() : Read data from session
Weerayut Hongsa : Network Engineer / Software Developer
Major Kantana Broadcasting Co., Ltd
https://kusumotolab.com
session : CodeIgniter session library
• $this->session->set_userdata()
• $this->session->unset_userdata()
• $this->session->userdata()
Weerayut Hongsa : Network Engineer / Software Developer
Major Kantana Broadcasting Co., Ltd
https://kusumotolab.com
input : CodeIgniter input library
(autoload)
• $this->input->post() : Get value from post method
• $this->input->get() : Get value from get method
• $this->input->cookie() : Get value from cookie
• $this->input->server() : Get value from server variable
Weerayut Hongsa : Network Engineer / Software Developer
Major Kantana Broadcasting Co., Ltd
https://kusumotolab.com
• $this->input->post()
Weerayut Hongsa : Network Engineer / Software Developer
Major Kantana Broadcasting Co., Ltd
https://kusumotolab.com
input : CodeIgniter input library
(autoload)
• $this->input->get()
input : CodeIgniter input library
(autoload)
Weerayut Hongsa : Network Engineer / Software Developer
Major Kantana Broadcasting Co., Ltd
https://kusumotolab.com
form_validation : CodeIgniter form
validate library
• $this->form_validation->set_rules() : Set form validate rule
• $this->form_validation->run() : Begin validation from rules
• validation_errors() : Show error if validation not pass
Weerayut Hongsa : Network Engineer / Software Developer
Major Kantana Broadcasting Co., Ltd
https://kusumotolab.com
form_validation : CodeIgniter form
validate library
• $this->form_validation->set_rules()
• $this->form_validation->run()
• validation_errors()
Weerayut Hongsa : Network Engineer / Software Developer
Major Kantana Broadcasting Co., Ltd
https://kusumotolab.com
form_validation : CodeIgniter form
validate library
Weerayut Hongsa : Network Engineer / Software Developer
Major Kantana Broadcasting Co., Ltd
https://kusumotolab.com
Rules in set_rules method
Forward to Workshop 004
Weerayut Hongsa : Network Engineer / Software Developer
Major Kantana Broadcasting Co., Ltd
https://kusumotolab.com

More Related Content

PDF
CodeIgniter For Project : Lesson 106 - Model
PDF
CodeIgniter For Project : Lesson 103 - Introduction to Codeigniter
PDF
CodeIgniter For Project : Lesson 104 - Controller & View
PPTX
Self-Hosta Web API
PPT
Phoenix and the Plug-life
PPTX
Introduction to ASP.NET Core
PPTX
Evolution / History of ASP.NET
PPTX
ASP.NET Core MVC + Web API with Overview (Post RC2)
CodeIgniter For Project : Lesson 106 - Model
CodeIgniter For Project : Lesson 103 - Introduction to Codeigniter
CodeIgniter For Project : Lesson 104 - Controller & View
Self-Hosta Web API
Phoenix and the Plug-life
Introduction to ASP.NET Core
Evolution / History of ASP.NET
ASP.NET Core MVC + Web API with Overview (Post RC2)

What's hot (20)

PPTX
ASP.NET Core: The best of the new bits
PPTX
Vaadin filtering table example
PDF
The Anatomy Of A Hack - WordCamp Sofia 2018
PPTX
.Net Core 1.0 vs .NET Framework
PPTX
Selenium Automation at Incapsula
PDF
GeckoDriver in Selenium WebDriver | Edureka
PPTX
Fullstack workshop
PDF
ColdFusion builder plugins
PPTX
Introduction to vaadin
PPTX
ASP.NET Core MVC + Web API with Overview
PDF
Net coreandsimplcommerce
PPTX
Introduction to .NET Core & ASP.NET Core MVC
PPTX
Nginx as a Revers Proxy for Apache on Ubuntu
PPTX
How to work with Selenium Grid: a quick walkthrough
PPT
CloudStack EC2 Configuration
PPTX
Debugging your Way through .NET with Visual Studio 2015
PDF
Using hapi plugins to version your API (hapiDays 2014)
PPTX
ASP.NET 5 Overview: Post RTM
PDF
SPUnite17 Deep Dive Building Solutions
PDF
Moving ASP.NET MVC to ASP.NET Core
ASP.NET Core: The best of the new bits
Vaadin filtering table example
The Anatomy Of A Hack - WordCamp Sofia 2018
.Net Core 1.0 vs .NET Framework
Selenium Automation at Incapsula
GeckoDriver in Selenium WebDriver | Edureka
Fullstack workshop
ColdFusion builder plugins
Introduction to vaadin
ASP.NET Core MVC + Web API with Overview
Net coreandsimplcommerce
Introduction to .NET Core & ASP.NET Core MVC
Nginx as a Revers Proxy for Apache on Ubuntu
How to work with Selenium Grid: a quick walkthrough
CloudStack EC2 Configuration
Debugging your Way through .NET with Visual Studio 2015
Using hapi plugins to version your API (hapiDays 2014)
ASP.NET 5 Overview: Post RTM
SPUnite17 Deep Dive Building Solutions
Moving ASP.NET MVC to ASP.NET Core
Ad

Viewers also liked (14)

DOCX
sredharselvam resume
PPT
Final scenario of the first story
PPSX
Empreendedorismo
PDF
Paso a paso para preinscribirnos en un curso con bolsa corporativa
DOCX
Recordatori taller de cuina de muntanya
DOCX
Ejemplos para la etapa 1
PPTX
Didactica de ciencias naturales
PPTX
Sistemas operativos
PDF
ニューヨーク州金融サービス局 金融サービス企業に対するサイバーセキュリティ規制
PPTX
Bio materials
PDF
ISO 21500
DOCX
Pfm 1 era-etapa
PPTX
Compliance CEF - Curso Monográfico de Compliance Officer
PDF
Agosto 2016 apoyos_005692
sredharselvam resume
Final scenario of the first story
Empreendedorismo
Paso a paso para preinscribirnos en un curso con bolsa corporativa
Recordatori taller de cuina de muntanya
Ejemplos para la etapa 1
Didactica de ciencias naturales
Sistemas operativos
ニューヨーク州金融サービス局 金融サービス企業に対するサイバーセキュリティ規制
Bio materials
ISO 21500
Pfm 1 era-etapa
Compliance CEF - Curso Monográfico de Compliance Officer
Agosto 2016 apoyos_005692
Ad

Similar to CodeIgniter For Project : Lesson 105 - Helper and Library (20)

PPTX
Codeigniter
PPT
Codeigniter
PPT
Introduction To CodeIgniter
PPTX
PPT
Introduction To Code Igniter
PPTX
CodeIgniter & MVC
PPTX
Introduction to codeigniter
PDF
Codeigniter
PPT
Benefits of the CodeIgniter Framework
PDF
Intro To Mvc Development In Php
PDF
Codeigniter
PPTX
CodeIgniter
ODP
Codegnitorppt
PDF
Introduction To CodeIgniter
PPT
Codeigniter simple explanation
PPTX
Advanced php code igniter framework
PPTX
CodeIgniter 101 Tutorial
PDF
Code igniter - A brief introduction
Codeigniter
Codeigniter
Introduction To CodeIgniter
Introduction To Code Igniter
CodeIgniter & MVC
Introduction to codeigniter
Codeigniter
Benefits of the CodeIgniter Framework
Intro To Mvc Development In Php
Codeigniter
CodeIgniter
Codegnitorppt
Introduction To CodeIgniter
Codeigniter simple explanation
Advanced php code igniter framework
CodeIgniter 101 Tutorial
Code igniter - A brief introduction

Recently uploaded (20)

PDF
Approach and Philosophy of On baking technology
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Encapsulation theory and applications.pdf
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Empathic Computing: Creating Shared Understanding
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPT
Teaching material agriculture food technology
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
Approach and Philosophy of On baking technology
“AI and Expert System Decision Support & Business Intelligence Systems”
Encapsulation theory and applications.pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Empathic Computing: Creating Shared Understanding
Programs and apps: productivity, graphics, security and other tools
Review of recent advances in non-invasive hemoglobin estimation
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Assigned Numbers - 2025 - Bluetooth® Document
sap open course for s4hana steps from ECC to s4
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
Unlocking AI with Model Context Protocol (MCP)
Dropbox Q2 2025 Financial Results & Investor Presentation
Per capita expenditure prediction using model stacking based on satellite ima...
Diabetes mellitus diagnosis method based random forest with bat algorithm
Teaching material agriculture food technology
Agricultural_Statistics_at_a_Glance_2022_0.pdf
The AUB Centre for AI in Media Proposal.docx

CodeIgniter For Project : Lesson 105 - Helper and Library

  • 1. CodeIgniter For ProjectLesson 105 : Helper and Library Weerayut Hongsa : Network Engineer / Software Developer Major Kantana Broadcasting Co., Ltd https://kusumotolab.com
  • 2. Helper “Helpers, as the name suggests, help you with tasks. Each helper file is simply a collection of functions in a particular category” Weerayut Hongsa : Network Engineer / Software Developer Major Kantana Broadcasting Co., Ltd https://kusumotolab.com
  • 3. Helper load code • $this->load->helper([helper name]); Weerayut Hongsa : Network Engineer / Software Developer Major Kantana Broadcasting Co., Ltd https://kusumotolab.com You can load helper on constructor and function in Controller
  • 4. Helper frequently used • url : URL helper utility • form : Form helper utility Weerayut Hongsa : Network Engineer / Software Developer Major Kantana Broadcasting Co., Ltd https://kusumotolab.com
  • 5. url : URL helper utility • site_url() : Get current url your website. • base_url() : Get current base path. Weerayut Hongsa : Network Engineer / Software Developer Major Kantana Broadcasting Co., Ltd https://kusumotolab.com
  • 6. url : URL helper utility • base_url() Weerayut Hongsa : Network Engineer / Software Developer Major Kantana Broadcasting Co., Ltd https://kusumotolab.com
  • 7. url : URL helper utility • site_url() Weerayut Hongsa : Network Engineer / Software Developer Major Kantana Broadcasting Co., Ltd https://kusumotolab.com
  • 8. form : Form helper utility • form_open() : Auto form open generate • form_close() : Auto form close generate Weerayut Hongsa : Network Engineer / Software Developer Major Kantana Broadcasting Co., Ltd https://kusumotolab.com
  • 9. form : Form helper utility • form_open() • form_close() Weerayut Hongsa : Network Engineer / Software Developer Major Kantana Broadcasting Co., Ltd https://kusumotolab.com
  • 10. Library Weerayut Hongsa : Network Engineer / Software Developer Major Kantana Broadcasting Co., Ltd https://kusumotolab.com
  • 11. Library load code • $this->load->library([library name]); Weerayut Hongsa : Network Engineer / Software Developer Major Kantana Broadcasting Co., Ltd https://kusumotolab.com You can load library on constructor and function in Controller
  • 12. Library frequently used • session : CodeIgniter session library • input : CodeIgniter input library (autoload) • load : CodeIgniter library loader (autoload) • form_validation : CodeIgniter form validate library Weerayut Hongsa : Network Engineer / Software Developer Major Kantana Broadcasting Co., Ltd https://kusumotolab.com
  • 13. session : CodeIgniter session library • $this->session->set_userdata() : Set user data session • $this->session->unset_userdata() : Unset user data session • $this->session->userdata() : Read data from session Weerayut Hongsa : Network Engineer / Software Developer Major Kantana Broadcasting Co., Ltd https://kusumotolab.com
  • 14. session : CodeIgniter session library • $this->session->set_userdata() • $this->session->unset_userdata() • $this->session->userdata() Weerayut Hongsa : Network Engineer / Software Developer Major Kantana Broadcasting Co., Ltd https://kusumotolab.com
  • 15. input : CodeIgniter input library (autoload) • $this->input->post() : Get value from post method • $this->input->get() : Get value from get method • $this->input->cookie() : Get value from cookie • $this->input->server() : Get value from server variable Weerayut Hongsa : Network Engineer / Software Developer Major Kantana Broadcasting Co., Ltd https://kusumotolab.com
  • 16. • $this->input->post() Weerayut Hongsa : Network Engineer / Software Developer Major Kantana Broadcasting Co., Ltd https://kusumotolab.com input : CodeIgniter input library (autoload)
  • 17. • $this->input->get() input : CodeIgniter input library (autoload) Weerayut Hongsa : Network Engineer / Software Developer Major Kantana Broadcasting Co., Ltd https://kusumotolab.com
  • 18. form_validation : CodeIgniter form validate library • $this->form_validation->set_rules() : Set form validate rule • $this->form_validation->run() : Begin validation from rules • validation_errors() : Show error if validation not pass Weerayut Hongsa : Network Engineer / Software Developer Major Kantana Broadcasting Co., Ltd https://kusumotolab.com
  • 19. form_validation : CodeIgniter form validate library • $this->form_validation->set_rules() • $this->form_validation->run() • validation_errors() Weerayut Hongsa : Network Engineer / Software Developer Major Kantana Broadcasting Co., Ltd https://kusumotolab.com
  • 20. form_validation : CodeIgniter form validate library Weerayut Hongsa : Network Engineer / Software Developer Major Kantana Broadcasting Co., Ltd https://kusumotolab.com Rules in set_rules method
  • 21. Forward to Workshop 004 Weerayut Hongsa : Network Engineer / Software Developer Major Kantana Broadcasting Co., Ltd https://kusumotolab.com