SlideShare une entreprise Scribd logo
1  sur  39
Fairfield County PHP Meetup




 Modular PHP dev using
CodeIgniter Bonfire
About Jeff Fox (@jfox015)
• Senior Level Web Developer
• Veteran of two browser wars and the dot-
  com bubble

• Fully self taught
• Studied Art and Music Production
• Baseball enthusiast (ney fanatic)
Meetup Overview
• MVC, CodeIgniter and HMVC in 5
    mins.
•   Intro to Bonfire (more than 5
    minutes)
•   Anatomy of a Bonfire Module
•   Practical Example
•   Q&A
Modular Development

Taking HUGE monolithic applications




and breaking them into manageable pieces
Modular Development

    "How the heck do we do that?"
Model, View, Controller




     Controllers
     handle requests




Models                      Views
                            present information
represent data
                            to the user
CodeIgniter
CodeIgniter



•    Popular Open Source PHP Framework

•    Simple MVC Based Architecture

•    Tons of tools and libraries to utilize in site
     development workflow

•    Flexible View system

•    Known for performance and documentation
CodeIgniter
CodeIgniter



•    Originally built and released by Ellis Labs, the
     Expression Engine people

•    "Reactor" is the community driven build and
     release initiative

•    Core team of developers oversee active
     development and releases

•    One of the "big three" PHP Frameworks
CodeIgniter
CodeIgniter




Application Flowchart
Hierarchical Model, View,
  Controller

HMVC Triads
call on and use other
MVC triads to
accomplish goals of
the application
CodeIgniter
  Bonfire
Bonfire Basics
CodeIgniter



• Open Source library built on top of
     CodeIgniter

• HMVC design using Modular Extensions
• Pre-built Administrative Dashboard
• Rich user authentication workflow
• Variety of site admin tools and utilities
Bonfire Basics
CodeIgniter



• Dashboard utilizes "contexts" for building
     admin tools

• Database migrations manage upgrades
     and fallbacks

• Custom Model class with built in SQL
     helper functionality

• Several classes of abstract controllers
Bonfire Basics
CodeIgniter



• Includes a system of roles to assign to
  users
• Robust permissions allows for precise
     control over site privileges and user
     access
•    Standard system for storing and
     accessing site settings
•    Includes a Module Builder wizard to
     generate fully compatible new modules
Functional Highlights
CodeIgniter



• Contexts provide a loosely coupled way
     to build Admin tools

• Naming conventions prevent hard coding
     menus

• Each module can have its own admin
     tools and still stay loosely coupled
Functional Highlights
CodeIgniter


Themes and Templates
• UI Based on the Twitter Bootstrap
  libraryBonfire uses a theme and
  template system for views
• Numerous helper functions are
  available to send data to view
  classes, select themes, manually set
  views, set messaging and render the
  content
Functional Highlights
 CodeIgniter


Themes and Templates – Examples
Template::set('current_url',
current_url());

Template::set_message('The comments
selected were successfully deleted.',
'success');

Template::set_view('comments/index');

Template::render();
Functional Highlights
CodeIgniter


Migrations
•    Implements the CodeIgninter Migrations
     class

•    Adds ability for modules to use migrations

•    Auto loading of new migrations on app
     startup (configuable via settings)

•    Can use DBforge or Codeigniter Database
     Class and SQL
Functional Highlights
CodeIgniter



public function up()
{
   $this->dbforge-
>add_column('comments_threads',
array('module' => array('type'=>
'VARCHAR','constraint'   => 255,'default'
      => ''));
}
public function down()
{
   $this->dbforge-
>drop_column("comments_threads","module");
}
Functional Highlights
CodeIgniter


Assets Lib
• Allows you to add JavaScript, images
  and CSS automatically in the head
  and/or footer of the site

Assets::add_js($this->load-
>view('thread_view_js',array('th
read_id'=>$thread_id), true),'in
line');
Functional Highlights
CodeIgniter


Modular Everything
•All core Dashboard features are
 modules
    •   Users         •   Translate Tool
    •   Activities    •   Module Builder
    •   Migrations    •   Logos
    •   Permissions   •   Emailer
    •   Roles         •   UI
    •   Settings      •   Updater
    •   Sysinfo       •   Database
Functional Highlights
CodeIgniter



Easy Install

Two step install
Like Wordpress
Bonfire Team
CodeIgniter




              Lonnie Ezell      Nuno Costa
              Project Founder
                                Ben Evans
                                Icehawg
              Sean Downey and many more on
                                Github.com

              Shawn Crigger
Anatomy of a
Bonfire Module
General Structure
CodeIgniter




• All third party and
     custom modules are
     stored in the "modules"
     folder in the bonfire
     directory.
•    Core modules live in
     the "core_modules"
     folder in the
     application directory.
General Structure
 CodeIgniter


 • Bonfire Modules are like little stand-alone
      CodeIgniter apps

 •    Modules follow the context naming convention
      system to allow access to their controllers
      throughout the site

 •    Can be 100% standalone or work with other
      modules

 •    Optimally can be dropped into other apps
Naming Conventions
 CodeIgniter



Controllers
• Public accessible, add
    controller with a name
    that matches the
    modules folder name
•   Admin Dashboard (Also
    called the Springboard)
    Controllers, add a
    controller that matches
    the context name
Naming Conventions
CodeIgniter




Auto-Resolving Views

• For public views, and index.php to
  the modules "Views" folder
• Admin views, add a folder for the
     matching context in the "Views"
     folder with an index.php file in it.
Naming Conventions
CodeIgniter




Manually Resolving Views
• In the controller, before calling
     Template::render(), add a line to set
     the view using
     Template::set_view('view');
•    Any view from any loaded module
     can be used simply by specifying the
     module path and view name
Config
CodeIgniter




• config.php contains a simple array that
     identifies the module to the application
     and contain it's meta information

• Config folder may contain other files used
     to store information about the app

• Custom routes.php files can be used to
     add additional levels of URL->controller
     routing
Controllers
CodeIgniter




• Contains all controllers used by the
     modules

• Should extend one of the four main
     Bonfire controller types:
      o Base_Controller
      o Front_Controller
      o Authenticated_Controller
      o Admin_Controller
Views
CodeIgniter



• Adding an index.php file to the views
     folder makes it publically accessible

• Adding folders named for supported
     admin contexts with index.php files makes
     them accessible from admin menus

• No limit to number of view files there can
     be, how they're organized outside context
     rules or how they're called
Misc
CodeIgniter



• Models follow general CI model rules.
     Should extend BF_Model to gain Bonfire
     helper functionality.

• Migrations are used to install DB support
     and handle changes

• Language files support translations
• Can add helpers, libraries and assets as
     well
Practical
Example
Q&A
Resources
Resources
 CodeIgniter

 • Bonfire Learning Center
  http://www.
  http://cibonfire.com/docs/guides/

 • Github Repository
  https://github.com/ci-
  bonfire/Bonfire
Resources
 CodeIgniter

 • Tutorials on MVC, HMVC, CodeIgniter
  at http://net.tutsplus.com/

  See MVC for Noobs, CodeIgniter from Scratch,
  HMVC: an Introduction and Application

 • OOWP For Developers Tutorials
  http://www.aeoliandigital.com/archi
  ves/category/oowp
Resources
 CodeIgniter

 Example Modules:
 • News:
   https://github.com/jfox015/Bonfire-
   News

 • Comments:
     https://github.com/jfox015/Bonfire-
     Comments

Contenu connexe

Tendances

Head first docker
Head first dockerHead first docker
Head first dockerHan Qin
 
0から始めるコンテナの学び方(Kubernetes Novice Tokyo #14 発表資料)
0から始めるコンテナの学び方(Kubernetes Novice Tokyo #14 発表資料)0から始めるコンテナの学び方(Kubernetes Novice Tokyo #14 発表資料)
0から始めるコンテナの学び方(Kubernetes Novice Tokyo #14 発表資料)NTT DATA Technology & Innovation
 
#logstudy 01 rsyslog入門
#logstudy 01 rsyslog入門#logstudy 01 rsyslog入門
#logstudy 01 rsyslog入門Takashi Takizawa
 
PlantUML Plugin 紹介スライド
PlantUML Plugin 紹介スライドPlantUML Plugin 紹介スライド
PlantUML Plugin 紹介スライドChangeVision
 
Monitoramento de Vulnerabilidades com Zabbix, RHEL e Yum Security Plugin
Monitoramento de Vulnerabilidades com Zabbix, RHEL e Yum Security PluginMonitoramento de Vulnerabilidades com Zabbix, RHEL e Yum Security Plugin
Monitoramento de Vulnerabilidades com Zabbix, RHEL e Yum Security PluginAlessandro Silva
 
第一回Web技術勉強会 efkスタック編
第一回Web技術勉強会 efkスタック編第一回Web技術勉強会 efkスタック編
第一回Web技術勉強会 efkスタック編tzm_freedom
 
KVM High Availability Regardless of Storage - Gabriel Brascher, VP of Apache ...
KVM High Availability Regardless of Storage - Gabriel Brascher, VP of Apache ...KVM High Availability Regardless of Storage - Gabriel Brascher, VP of Apache ...
KVM High Availability Regardless of Storage - Gabriel Brascher, VP of Apache ...ShapeBlue
 
JAVA_HOME/binにあるコマンド、いくつ使っていますか?[JVM関連ツール編](JJUGナイトセミナー「Java解析ツール特集」 発表資料)
JAVA_HOME/binにあるコマンド、いくつ使っていますか?[JVM関連ツール編](JJUGナイトセミナー「Java解析ツール特集」 発表資料)JAVA_HOME/binにあるコマンド、いくつ使っていますか?[JVM関連ツール編](JJUGナイトセミナー「Java解析ツール特集」 発表資料)
JAVA_HOME/binにあるコマンド、いくつ使っていますか?[JVM関連ツール編](JJUGナイトセミナー「Java解析ツール特集」 発表資料)NTT DATA Technology & Innovation
 
Enterprise Integration Patterns
Enterprise Integration PatternsEnterprise Integration Patterns
Enterprise Integration PatternsSergey Podolsky
 
Kubernetes Architecture - beyond a black box - Part 1
Kubernetes Architecture - beyond a black box - Part 1Kubernetes Architecture - beyond a black box - Part 1
Kubernetes Architecture - beyond a black box - Part 1Hao H. Zhang
 
Getting Started with Kubernetes
Getting Started with Kubernetes Getting Started with Kubernetes
Getting Started with Kubernetes VMware Tanzu
 
【GOJAS Meetup-10】Splunk:SmartStoreを使ってみた
【GOJAS Meetup-10】Splunk:SmartStoreを使ってみた【GOJAS Meetup-10】Splunk:SmartStoreを使ってみた
【GOJAS Meetup-10】Splunk:SmartStoreを使ってみたtokita-r
 
6 3 tier architecture php
6 3 tier architecture php6 3 tier architecture php
6 3 tier architecture phpcefour
 
CDC patterns in Apache Kafka®
CDC patterns in Apache Kafka®CDC patterns in Apache Kafka®
CDC patterns in Apache Kafka®confluent
 
Docker multi-stage build
Docker multi-stage buildDocker multi-stage build
Docker multi-stage buildAlexei Ledenev
 
Open Liberty: オープンソースになったWebSphere Liberty
Open Liberty: オープンソースになったWebSphere LibertyOpen Liberty: オープンソースになったWebSphere Liberty
Open Liberty: オープンソースになったWebSphere LibertyTakakiyo Tanaka
 
Chef Tutorial | Chef Tutorial For Beginners | DevOps Chef Tutorial | DevOps T...
Chef Tutorial | Chef Tutorial For Beginners | DevOps Chef Tutorial | DevOps T...Chef Tutorial | Chef Tutorial For Beginners | DevOps Chef Tutorial | DevOps T...
Chef Tutorial | Chef Tutorial For Beginners | DevOps Chef Tutorial | DevOps T...Simplilearn
 
kube-system落としてみました
kube-system落としてみましたkube-system落としてみました
kube-system落としてみましたShuntaro Saiba
 

Tendances (20)

Head first docker
Head first dockerHead first docker
Head first docker
 
0から始めるコンテナの学び方(Kubernetes Novice Tokyo #14 発表資料)
0から始めるコンテナの学び方(Kubernetes Novice Tokyo #14 発表資料)0から始めるコンテナの学び方(Kubernetes Novice Tokyo #14 発表資料)
0から始めるコンテナの学び方(Kubernetes Novice Tokyo #14 発表資料)
 
#logstudy 01 rsyslog入門
#logstudy 01 rsyslog入門#logstudy 01 rsyslog入門
#logstudy 01 rsyslog入門
 
PlantUML Plugin 紹介スライド
PlantUML Plugin 紹介スライドPlantUML Plugin 紹介スライド
PlantUML Plugin 紹介スライド
 
Twitter Finagle
Twitter FinagleTwitter Finagle
Twitter Finagle
 
Monitoramento de Vulnerabilidades com Zabbix, RHEL e Yum Security Plugin
Monitoramento de Vulnerabilidades com Zabbix, RHEL e Yum Security PluginMonitoramento de Vulnerabilidades com Zabbix, RHEL e Yum Security Plugin
Monitoramento de Vulnerabilidades com Zabbix, RHEL e Yum Security Plugin
 
第一回Web技術勉強会 efkスタック編
第一回Web技術勉強会 efkスタック編第一回Web技術勉強会 efkスタック編
第一回Web技術勉強会 efkスタック編
 
KVM High Availability Regardless of Storage - Gabriel Brascher, VP of Apache ...
KVM High Availability Regardless of Storage - Gabriel Brascher, VP of Apache ...KVM High Availability Regardless of Storage - Gabriel Brascher, VP of Apache ...
KVM High Availability Regardless of Storage - Gabriel Brascher, VP of Apache ...
 
NGINXでの認可について考える
NGINXでの認可について考えるNGINXでの認可について考える
NGINXでの認可について考える
 
JAVA_HOME/binにあるコマンド、いくつ使っていますか?[JVM関連ツール編](JJUGナイトセミナー「Java解析ツール特集」 発表資料)
JAVA_HOME/binにあるコマンド、いくつ使っていますか?[JVM関連ツール編](JJUGナイトセミナー「Java解析ツール特集」 発表資料)JAVA_HOME/binにあるコマンド、いくつ使っていますか?[JVM関連ツール編](JJUGナイトセミナー「Java解析ツール特集」 発表資料)
JAVA_HOME/binにあるコマンド、いくつ使っていますか?[JVM関連ツール編](JJUGナイトセミナー「Java解析ツール特集」 発表資料)
 
Enterprise Integration Patterns
Enterprise Integration PatternsEnterprise Integration Patterns
Enterprise Integration Patterns
 
Kubernetes Architecture - beyond a black box - Part 1
Kubernetes Architecture - beyond a black box - Part 1Kubernetes Architecture - beyond a black box - Part 1
Kubernetes Architecture - beyond a black box - Part 1
 
Getting Started with Kubernetes
Getting Started with Kubernetes Getting Started with Kubernetes
Getting Started with Kubernetes
 
【GOJAS Meetup-10】Splunk:SmartStoreを使ってみた
【GOJAS Meetup-10】Splunk:SmartStoreを使ってみた【GOJAS Meetup-10】Splunk:SmartStoreを使ってみた
【GOJAS Meetup-10】Splunk:SmartStoreを使ってみた
 
6 3 tier architecture php
6 3 tier architecture php6 3 tier architecture php
6 3 tier architecture php
 
CDC patterns in Apache Kafka®
CDC patterns in Apache Kafka®CDC patterns in Apache Kafka®
CDC patterns in Apache Kafka®
 
Docker multi-stage build
Docker multi-stage buildDocker multi-stage build
Docker multi-stage build
 
Open Liberty: オープンソースになったWebSphere Liberty
Open Liberty: オープンソースになったWebSphere LibertyOpen Liberty: オープンソースになったWebSphere Liberty
Open Liberty: オープンソースになったWebSphere Liberty
 
Chef Tutorial | Chef Tutorial For Beginners | DevOps Chef Tutorial | DevOps T...
Chef Tutorial | Chef Tutorial For Beginners | DevOps Chef Tutorial | DevOps T...Chef Tutorial | Chef Tutorial For Beginners | DevOps Chef Tutorial | DevOps T...
Chef Tutorial | Chef Tutorial For Beginners | DevOps Chef Tutorial | DevOps T...
 
kube-system落としてみました
kube-system落としてみましたkube-system落としてみました
kube-system落としてみました
 

En vedette

ACL in CodeIgniter
ACL in CodeIgniterACL in CodeIgniter
ACL in CodeIgnitermirahman
 
CodeIgniter - PHP MVC Framework by silicongulf.com
CodeIgniter - PHP MVC Framework by silicongulf.comCodeIgniter - PHP MVC Framework by silicongulf.com
CodeIgniter - PHP MVC Framework by silicongulf.comChristopher Cubos
 
CodeIgniter PHP MVC Framework
CodeIgniter PHP MVC FrameworkCodeIgniter PHP MVC Framework
CodeIgniter PHP MVC FrameworkBo-Yi Wu
 
Oop in-php
Oop in-phpOop in-php
Oop in-phpRajesh S
 
Modul 3 Cara Membuat View Pada CodeIgniter
Modul 3 Cara Membuat View Pada CodeIgniterModul 3 Cara Membuat View Pada CodeIgniter
Modul 3 Cara Membuat View Pada CodeIgniterRiki Afriansyah
 
You must know about CodeIgniter Popular Library
You must know about CodeIgniter Popular LibraryYou must know about CodeIgniter Popular Library
You must know about CodeIgniter Popular LibraryBo-Yi Wu
 
Momchil Kyurkchiev Presentation
Momchil Kyurkchiev PresentationMomchil Kyurkchiev Presentation
Momchil Kyurkchiev PresentationStart It Smart
 
Benefits of the CodeIgniter Framework
Benefits of the CodeIgniter FrameworkBenefits of the CodeIgniter Framework
Benefits of the CodeIgniter FrameworkToby Beresford
 
Codeigniter : Two Step View - Concept Implementation
Codeigniter : Two Step View - Concept ImplementationCodeigniter : Two Step View - Concept Implementation
Codeigniter : Two Step View - Concept ImplementationAbdul Malik Ikhsan
 
2014 database - course 3 - PHP and MySQL
2014 database - course 3 - PHP and MySQL2014 database - course 3 - PHP and MySQL
2014 database - course 3 - PHP and MySQLHung-yu Lin
 
Codeigniter
CodeigniterCodeigniter
Codeignitershadowk
 
PHP Frameworks & Introduction to CodeIgniter
PHP Frameworks & Introduction to CodeIgniterPHP Frameworks & Introduction to CodeIgniter
PHP Frameworks & Introduction to CodeIgniterJamshid Hashimi
 
REST API Best Practices & Implementing in Codeigniter
REST API Best Practices & Implementing in CodeigniterREST API Best Practices & Implementing in Codeigniter
REST API Best Practices & Implementing in CodeigniterSachin G Kulkarni
 
Codeigniter : the security and the magic of hook
Codeigniter : the security and the magic of hookCodeigniter : the security and the magic of hook
Codeigniter : the security and the magic of hookAbdul Malik Ikhsan
 
RESTful API Design & Implementation with CodeIgniter PHP Framework
RESTful API Design & Implementation with CodeIgniter PHP FrameworkRESTful API Design & Implementation with CodeIgniter PHP Framework
RESTful API Design & Implementation with CodeIgniter PHP FrameworkBo-Yi Wu
 

En vedette (20)

ACL in CodeIgniter
ACL in CodeIgniterACL in CodeIgniter
ACL in CodeIgniter
 
CodeIgniter - PHP MVC Framework by silicongulf.com
CodeIgniter - PHP MVC Framework by silicongulf.comCodeIgniter - PHP MVC Framework by silicongulf.com
CodeIgniter - PHP MVC Framework by silicongulf.com
 
CodeIgniter PHP MVC Framework
CodeIgniter PHP MVC FrameworkCodeIgniter PHP MVC Framework
CodeIgniter PHP MVC Framework
 
Php mysql ppt
Php mysql pptPhp mysql ppt
Php mysql ppt
 
Codeigniter
CodeigniterCodeigniter
Codeigniter
 
Oop in-php
Oop in-phpOop in-php
Oop in-php
 
Modul 3 Cara Membuat View Pada CodeIgniter
Modul 3 Cara Membuat View Pada CodeIgniterModul 3 Cara Membuat View Pada CodeIgniter
Modul 3 Cara Membuat View Pada CodeIgniter
 
CodeIgniter 3.0
CodeIgniter 3.0CodeIgniter 3.0
CodeIgniter 3.0
 
You must know about CodeIgniter Popular Library
You must know about CodeIgniter Popular LibraryYou must know about CodeIgniter Popular Library
You must know about CodeIgniter Popular Library
 
Momchil Kyurkchiev Presentation
Momchil Kyurkchiev PresentationMomchil Kyurkchiev Presentation
Momchil Kyurkchiev Presentation
 
Benefits of the CodeIgniter Framework
Benefits of the CodeIgniter FrameworkBenefits of the CodeIgniter Framework
Benefits of the CodeIgniter Framework
 
Codeigniter : Two Step View - Concept Implementation
Codeigniter : Two Step View - Concept ImplementationCodeigniter : Two Step View - Concept Implementation
Codeigniter : Two Step View - Concept Implementation
 
2014 database - course 3 - PHP and MySQL
2014 database - course 3 - PHP and MySQL2014 database - course 3 - PHP and MySQL
2014 database - course 3 - PHP and MySQL
 
DB design
DB designDB design
DB design
 
Codeigniter
CodeigniterCodeigniter
Codeigniter
 
PHP Frameworks & Introduction to CodeIgniter
PHP Frameworks & Introduction to CodeIgniterPHP Frameworks & Introduction to CodeIgniter
PHP Frameworks & Introduction to CodeIgniter
 
REST API Best Practices & Implementing in Codeigniter
REST API Best Practices & Implementing in CodeigniterREST API Best Practices & Implementing in Codeigniter
REST API Best Practices & Implementing in Codeigniter
 
Week 3 database design
Week 3   database designWeek 3   database design
Week 3 database design
 
Codeigniter : the security and the magic of hook
Codeigniter : the security and the magic of hookCodeigniter : the security and the magic of hook
Codeigniter : the security and the magic of hook
 
RESTful API Design & Implementation with CodeIgniter PHP Framework
RESTful API Design & Implementation with CodeIgniter PHP FrameworkRESTful API Design & Implementation with CodeIgniter PHP Framework
RESTful API Design & Implementation with CodeIgniter PHP Framework
 

Similaire à Modular PHP Development using CodeIgniter Bonfire

Blisstering drupal module development ppt v1.2
Blisstering drupal module development ppt v1.2Blisstering drupal module development ppt v1.2
Blisstering drupal module development ppt v1.2Anil Sagar
 
ITB_2023_Extend_your_contentbox_apps_with_custom_modules_Javier_Quintero.pdf
ITB_2023_Extend_your_contentbox_apps_with_custom_modules_Javier_Quintero.pdfITB_2023_Extend_your_contentbox_apps_with_custom_modules_Javier_Quintero.pdf
ITB_2023_Extend_your_contentbox_apps_with_custom_modules_Javier_Quintero.pdfOrtus Solutions, Corp
 
Sitecore development approach evolution – destination helix
Sitecore development approach evolution – destination helixSitecore development approach evolution – destination helix
Sitecore development approach evolution – destination helixPeter Nazarov
 
Codestrong 2012 breakout session how to develop your own modules
Codestrong 2012 breakout session   how to develop your own modulesCodestrong 2012 breakout session   how to develop your own modules
Codestrong 2012 breakout session how to develop your own modulesAxway Appcelerator
 
Introduction to Module Development with Appcelerator Titanium
Introduction to Module Development with Appcelerator TitaniumIntroduction to Module Development with Appcelerator Titanium
Introduction to Module Development with Appcelerator TitaniumAaron Saunders
 
Coonti in HelsinkiJS
Coonti in HelsinkiJSCoonti in HelsinkiJS
Coonti in HelsinkiJSCoonti
 
Anna Fedoruk.Theworkflow.DrupalCamp Kyiv 2011
Anna Fedoruk.Theworkflow.DrupalCamp Kyiv 2011Anna Fedoruk.Theworkflow.DrupalCamp Kyiv 2011
Anna Fedoruk.Theworkflow.DrupalCamp Kyiv 2011camp_drupal_ua
 
Innovations in Sencha Tooling and Framework
Innovations in Sencha Tooling and FrameworkInnovations in Sencha Tooling and Framework
Innovations in Sencha Tooling and FrameworkSandeep Adwankar
 
Alibaba Cloud Conference 2016 - Docker Open Source
Alibaba Cloud Conference   2016 - Docker Open Source Alibaba Cloud Conference   2016 - Docker Open Source
Alibaba Cloud Conference 2016 - Docker Open Source John Willis
 
Code igniter development
Code igniter developmentCode igniter development
Code igniter developmentMobiloitte
 
Headless cms architecture
Headless cms architectureHeadless cms architecture
Headless cms architectureKevin Wenger
 
Presentation 1 Web--dev
Presentation 1 Web--devPresentation 1 Web--dev
Presentation 1 Web--devaltsav
 
Beyond Domino Designer
Beyond Domino DesignerBeyond Domino Designer
Beyond Domino DesignerPaul Withers
 
East Coast DevCon 2014: Engine Overview - A Programmer’s Glimpse at UE4
East Coast DevCon 2014: Engine Overview - A Programmer’s Glimpse at UE4East Coast DevCon 2014: Engine Overview - A Programmer’s Glimpse at UE4
East Coast DevCon 2014: Engine Overview - A Programmer’s Glimpse at UE4Gerke Max Preussner
 
Dot net Online Training | .Net Training and Placement online
Dot net Online Training | .Net Training and Placement onlineDot net Online Training | .Net Training and Placement online
Dot net Online Training | .Net Training and Placement onlineGaruda Trainings
 
Get Codeigniter Developement Services From Us
 Get Codeigniter Developement Services From Us Get Codeigniter Developement Services From Us
Get Codeigniter Developement Services From UsJoe_Mason
 

Similaire à Modular PHP Development using CodeIgniter Bonfire (20)

Seminar.pptx
Seminar.pptxSeminar.pptx
Seminar.pptx
 
Blisstering drupal module development ppt v1.2
Blisstering drupal module development ppt v1.2Blisstering drupal module development ppt v1.2
Blisstering drupal module development ppt v1.2
 
ITB_2023_Extend_your_contentbox_apps_with_custom_modules_Javier_Quintero.pdf
ITB_2023_Extend_your_contentbox_apps_with_custom_modules_Javier_Quintero.pdfITB_2023_Extend_your_contentbox_apps_with_custom_modules_Javier_Quintero.pdf
ITB_2023_Extend_your_contentbox_apps_with_custom_modules_Javier_Quintero.pdf
 
Sitecore development approach evolution – destination helix
Sitecore development approach evolution – destination helixSitecore development approach evolution – destination helix
Sitecore development approach evolution – destination helix
 
Codeigniter framework
Codeigniter framework Codeigniter framework
Codeigniter framework
 
Codestrong 2012 breakout session how to develop your own modules
Codestrong 2012 breakout session   how to develop your own modulesCodestrong 2012 breakout session   how to develop your own modules
Codestrong 2012 breakout session how to develop your own modules
 
Introduction to Module Development with Appcelerator Titanium
Introduction to Module Development with Appcelerator TitaniumIntroduction to Module Development with Appcelerator Titanium
Introduction to Module Development with Appcelerator Titanium
 
Coonti in HelsinkiJS
Coonti in HelsinkiJSCoonti in HelsinkiJS
Coonti in HelsinkiJS
 
Anna Fedoruk.Theworkflow.DrupalCamp Kyiv 2011
Anna Fedoruk.Theworkflow.DrupalCamp Kyiv 2011Anna Fedoruk.Theworkflow.DrupalCamp Kyiv 2011
Anna Fedoruk.Theworkflow.DrupalCamp Kyiv 2011
 
Innovations in Sencha Tooling and Framework
Innovations in Sencha Tooling and FrameworkInnovations in Sencha Tooling and Framework
Innovations in Sencha Tooling and Framework
 
Alibaba Cloud Conference 2016 - Docker Open Source
Alibaba Cloud Conference   2016 - Docker Open Source Alibaba Cloud Conference   2016 - Docker Open Source
Alibaba Cloud Conference 2016 - Docker Open Source
 
Code igniter development
Code igniter developmentCode igniter development
Code igniter development
 
Codeinator
CodeinatorCodeinator
Codeinator
 
Headless cms architecture
Headless cms architectureHeadless cms architecture
Headless cms architecture
 
Presentation 1 Web--dev
Presentation 1 Web--devPresentation 1 Web--dev
Presentation 1 Web--dev
 
Beyond Domino Designer
Beyond Domino DesignerBeyond Domino Designer
Beyond Domino Designer
 
East Coast DevCon 2014: Engine Overview - A Programmer’s Glimpse at UE4
East Coast DevCon 2014: Engine Overview - A Programmer’s Glimpse at UE4East Coast DevCon 2014: Engine Overview - A Programmer’s Glimpse at UE4
East Coast DevCon 2014: Engine Overview - A Programmer’s Glimpse at UE4
 
Dot net Online Training | .Net Training and Placement online
Dot net Online Training | .Net Training and Placement onlineDot net Online Training | .Net Training and Placement online
Dot net Online Training | .Net Training and Placement online
 
72d5drupal
72d5drupal72d5drupal
72d5drupal
 
Get Codeigniter Developement Services From Us
 Get Codeigniter Developement Services From Us Get Codeigniter Developement Services From Us
Get Codeigniter Developement Services From Us
 

Dernier

unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 

Dernier (20)

unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 

Modular PHP Development using CodeIgniter Bonfire

  • 1. Fairfield County PHP Meetup Modular PHP dev using CodeIgniter Bonfire
  • 2. About Jeff Fox (@jfox015) • Senior Level Web Developer • Veteran of two browser wars and the dot- com bubble • Fully self taught • Studied Art and Music Production • Baseball enthusiast (ney fanatic)
  • 3. Meetup Overview • MVC, CodeIgniter and HMVC in 5 mins. • Intro to Bonfire (more than 5 minutes) • Anatomy of a Bonfire Module • Practical Example • Q&A
  • 4. Modular Development Taking HUGE monolithic applications and breaking them into manageable pieces
  • 5. Modular Development "How the heck do we do that?"
  • 6. Model, View, Controller Controllers handle requests Models Views present information represent data to the user
  • 7. CodeIgniter CodeIgniter • Popular Open Source PHP Framework • Simple MVC Based Architecture • Tons of tools and libraries to utilize in site development workflow • Flexible View system • Known for performance and documentation
  • 8. CodeIgniter CodeIgniter • Originally built and released by Ellis Labs, the Expression Engine people • "Reactor" is the community driven build and release initiative • Core team of developers oversee active development and releases • One of the "big three" PHP Frameworks
  • 10. Hierarchical Model, View, Controller HMVC Triads call on and use other MVC triads to accomplish goals of the application
  • 12. Bonfire Basics CodeIgniter • Open Source library built on top of CodeIgniter • HMVC design using Modular Extensions • Pre-built Administrative Dashboard • Rich user authentication workflow • Variety of site admin tools and utilities
  • 13. Bonfire Basics CodeIgniter • Dashboard utilizes "contexts" for building admin tools • Database migrations manage upgrades and fallbacks • Custom Model class with built in SQL helper functionality • Several classes of abstract controllers
  • 14. Bonfire Basics CodeIgniter • Includes a system of roles to assign to users • Robust permissions allows for precise control over site privileges and user access • Standard system for storing and accessing site settings • Includes a Module Builder wizard to generate fully compatible new modules
  • 15. Functional Highlights CodeIgniter • Contexts provide a loosely coupled way to build Admin tools • Naming conventions prevent hard coding menus • Each module can have its own admin tools and still stay loosely coupled
  • 16. Functional Highlights CodeIgniter Themes and Templates • UI Based on the Twitter Bootstrap libraryBonfire uses a theme and template system for views • Numerous helper functions are available to send data to view classes, select themes, manually set views, set messaging and render the content
  • 17. Functional Highlights CodeIgniter Themes and Templates – Examples Template::set('current_url', current_url()); Template::set_message('The comments selected were successfully deleted.', 'success'); Template::set_view('comments/index'); Template::render();
  • 18. Functional Highlights CodeIgniter Migrations • Implements the CodeIgninter Migrations class • Adds ability for modules to use migrations • Auto loading of new migrations on app startup (configuable via settings) • Can use DBforge or Codeigniter Database Class and SQL
  • 19. Functional Highlights CodeIgniter public function up() { $this->dbforge- >add_column('comments_threads', array('module' => array('type'=> 'VARCHAR','constraint' => 255,'default' => '')); } public function down() { $this->dbforge- >drop_column("comments_threads","module"); }
  • 20. Functional Highlights CodeIgniter Assets Lib • Allows you to add JavaScript, images and CSS automatically in the head and/or footer of the site Assets::add_js($this->load- >view('thread_view_js',array('th read_id'=>$thread_id), true),'in line');
  • 21. Functional Highlights CodeIgniter Modular Everything •All core Dashboard features are modules • Users • Translate Tool • Activities • Module Builder • Migrations • Logos • Permissions • Emailer • Roles • UI • Settings • Updater • Sysinfo • Database
  • 23. Bonfire Team CodeIgniter Lonnie Ezell Nuno Costa Project Founder Ben Evans Icehawg Sean Downey and many more on Github.com Shawn Crigger
  • 25. General Structure CodeIgniter • All third party and custom modules are stored in the "modules" folder in the bonfire directory. • Core modules live in the "core_modules" folder in the application directory.
  • 26. General Structure CodeIgniter • Bonfire Modules are like little stand-alone CodeIgniter apps • Modules follow the context naming convention system to allow access to their controllers throughout the site • Can be 100% standalone or work with other modules • Optimally can be dropped into other apps
  • 27. Naming Conventions CodeIgniter Controllers • Public accessible, add controller with a name that matches the modules folder name • Admin Dashboard (Also called the Springboard) Controllers, add a controller that matches the context name
  • 28. Naming Conventions CodeIgniter Auto-Resolving Views • For public views, and index.php to the modules "Views" folder • Admin views, add a folder for the matching context in the "Views" folder with an index.php file in it.
  • 29. Naming Conventions CodeIgniter Manually Resolving Views • In the controller, before calling Template::render(), add a line to set the view using Template::set_view('view'); • Any view from any loaded module can be used simply by specifying the module path and view name
  • 30. Config CodeIgniter • config.php contains a simple array that identifies the module to the application and contain it's meta information • Config folder may contain other files used to store information about the app • Custom routes.php files can be used to add additional levels of URL->controller routing
  • 31. Controllers CodeIgniter • Contains all controllers used by the modules • Should extend one of the four main Bonfire controller types: o Base_Controller o Front_Controller o Authenticated_Controller o Admin_Controller
  • 32. Views CodeIgniter • Adding an index.php file to the views folder makes it publically accessible • Adding folders named for supported admin contexts with index.php files makes them accessible from admin menus • No limit to number of view files there can be, how they're organized outside context rules or how they're called
  • 33. Misc CodeIgniter • Models follow general CI model rules. Should extend BF_Model to gain Bonfire helper functionality. • Migrations are used to install DB support and handle changes • Language files support translations • Can add helpers, libraries and assets as well
  • 35. Q&A
  • 37. Resources CodeIgniter • Bonfire Learning Center http://www. http://cibonfire.com/docs/guides/ • Github Repository https://github.com/ci- bonfire/Bonfire
  • 38. Resources CodeIgniter • Tutorials on MVC, HMVC, CodeIgniter at http://net.tutsplus.com/ See MVC for Noobs, CodeIgniter from Scratch, HMVC: an Introduction and Application • OOWP For Developers Tutorials http://www.aeoliandigital.com/archi ves/category/oowp
  • 39. Resources CodeIgniter Example Modules: • News: https://github.com/jfox015/Bonfire- News • Comments: https://github.com/jfox015/Bonfire- Comments