SlideShare a Scribd company logo
deep dive
deep dive[0] Introduction
$presentation = array(
'Introduction',
'Yii',
'Request Handling',
'Data Structure',
'Module & Plugin Overview',
'Q&A'
);
deep dive[1] Yii
deep dive[1] Yii
Yii is an object-oriented

model-view-controller

framework for PHP.
deep dive[1] Yii
deep dive[1] Yii
}
deep dive[1] Yii
Yii provides a way for
namespaces applications to
interact with each other.
deep dive[1] Yii
Yii provides routing.
deep dive[1] Yii
Yii provides twig.
deep dive[1] Yii
Yii provides error handling.
deep dive[1] Yii
Yii provides events.
deep dive[1] Yii
provides it's own routing.
🖕🖕
deep dive[1] Yii
provides its own twig.
🖕🖕
deep dive[1] Yii
doesn't provide it's
own error handling.
👍 👍
deep dive[1] Yii
doesn't provide it's
own events.
👍 👍
deep dive[1] Elements
use craftservicesElements;
deep dive[1] Elements
In Craft almost
everything is an element.
deep dive[2] Request Handling
Let's look at an incoming
Craft request.
deep dive
0.

The request will only go to
craft if the server routes it
to the index.php file.
[2] Request Handling
deep dive
1. Is it an action?

If the URL begins with
actions/ it gets routed to a
controller.
[2] Request Handling
deep dive
1. Is it an action?

The controller is either
built-in, or provided by a
module or plugin.
[2] Request Handling
deep dive
namespace craftcontrollers;
use Craft;
class UsersController extends Controller
{
public function actionLogin()
{
if (!Craft::$app->getUser()->getIsGuest()) {
// Too easy.
return $this->_handleSuccessfulLogin(false);
}
}
}
1. Is it an action?

The controller is
either built-in, or
provided by a
module or plugin.
GET /actions/users/active
POST /

<input type="hidden" name="action" value="users/save-user">
[2] Request Handling
deep dive
2. Is it an element?

Does it match an element's URI?
[2] Request Handling
deep dive
element:

a thing that can hold data
craftelementsAsset
craftelementsCategory
craftelementsEntry
craftelementsGlobalSet
craftelementsMatrixBlock
craftelementsTag
craftelementsUser
verbbsupertableelementsSuperTableBlockElement
[2] Request Handling
deep dive
craft_elements
id 28
fieldLayoutId 31
type craftelementsEntry
enabled 1
craft_elements_sites
id 32
elementId 28
siteId 1
slug about-us
uri company/about-us
[2] Request Handling
deep dive
craft_elements
id 28
fieldLayoutId 31
type craftelementsEntry
enabled 1
[2] Request Handling
deep dive
craft_elements
id 28
fieldLayoutId 31
type craftelementsEntry
enabled 1
craft_elements_sites
id 32
elementId 28
siteId 1
slug about-us
uri company/about-us
routing uri
[2] Request Handling
deep dive
3. Does the URI match a
route or URI rule?
return [
// Route blog/archive/YYYY to a controller action
'blog/archive/<year:d{4}>' => 'controller/action/path',
// Route blog/archive/YYYY to a template
'blog/archive/<year:d{4}>' => ['template' => 'blog/_archive'],
];
config/routes.php
<h1>Blog Entries from {{ year }}</h1>
[2] Request Handling
deep dive
4. Does the URI match a template?
@webroot/templates/single.twig
[2] Request Handling
deep dive
4. Does the URI match a template?
@webroot/templates/single.twig
Yii alias
[2] Request Handling
deep dive
5.Well I guess we'll just 404.
[2] Request Handling
deep dive[3] Data Structure
Let's visualize the
CraftCMS DB Structure
CraftCMS 3.x Deep Dive
deep dive
Ok maybe let's not do that.
[3] Data Structure
deep dive
Let's look at the
Wordpress schema.
[3] Data Structure
CraftCMS 3.x Deep Dive
deep dive[4] Module & Plugin Overview
Not suited for the complex
content architecture we require.
deep dive[4] Module & Plugin Overview
Let's talk about plugins.
deep dive
Plugins and modules are
basically justYii modules
(sort of like Craft is!)
[4] Module & Plugin Overview
deep dive
Plugins:
Installed through Composer,

can be turned on and off in admin.

(Usually) site-agnostic functionality
Modules:
Hardcoded into composer andYii
configs. Cannot be turned off in admin.

(Usually) site-specific functionality
[4] Module & Plugin Overview
deep dive[4] Module & Plugin Overview
deep dive
This is meta because Craft implements
all of these things on its own.
[4] Module & Plugin Overview
deep dive
CSS, JS, and Images needed in the
Admin side of Craft
[4] Module & Plugin Overview
deep dive
Tasks that can be run through
the Craft CLI
[4] Module & Plugin Overview
deep dive
Endpoints that are accessible
through a URL path
[4] Module & Plugin Overview
deep dive
Main application class file.
Registers hooks, events, etc
[4] Module & Plugin Overview
deep dive
New elements (like SuperTable
Blocks for example)
[4] Module & Plugin Overview
deep dive
New fields (like a markdown
editor that stores HTML)
[4] Module & Plugin Overview
deep dive
New queued tasks (like image
transformation)
[4] Module & Plugin Overview
deep dive
Installation / uninstallation
migrations
[4] Module & Plugin Overview
deep dive
A "template" for a custom data
structure
[4] Module & Plugin Overview
deep dive
A way to represent data
from a model and define
how it is stored / retrieved in
the DB
[4] Module & Plugin Overview
deep dive
The "business logic" of the
application/plugin/module
[4] Module & Plugin Overview
deep dive
Twig templates for the admin
side of your plugin
[4] Module & Plugin Overview
deep dive
Functional additions toTwig
(like twig-dig!)
[4] Module & Plugin Overview
deep dive
Add twig pages that appear
under "Utilities" in the Admin
[4] Module & Plugin Overview
deep dive
Add custom twig variables
accessible under the craft
namespace. (Like
{{ craft.testvariable }})
[4] Module & Plugin Overview
deep dive
Widgets for the admin dashboard.
[4] Module & Plugin Overview
deep dive[5] Q & A
Q&A

More Related Content

PPSX
JQuery Comprehensive Overview
Mohamed Loey
 
PPT
J query intro_29thsep_alok
SPRITLE SOFTWARE PRIVATE LIMIT ED
 
PPT
Introduction to j query
thewarlog
 
PDF
The Future of Plugin Dev
Brandon Kelly
 
PDF
Supercharging WordPress Development - Wordcamp Brighton 2019
Adam Tomat
 
PDF
[Bristol WordPress] Supercharging WordPress Development
Adam Tomat
 
PDF
Yii, frameworks and where PHP is heading to
Alexander Makarov
 
JQuery Comprehensive Overview
Mohamed Loey
 
J query intro_29thsep_alok
SPRITLE SOFTWARE PRIVATE LIMIT ED
 
Introduction to j query
thewarlog
 
The Future of Plugin Dev
Brandon Kelly
 
Supercharging WordPress Development - Wordcamp Brighton 2019
Adam Tomat
 
[Bristol WordPress] Supercharging WordPress Development
Adam Tomat
 
Yii, frameworks and where PHP is heading to
Alexander Makarov
 

Similar to CraftCMS 3.x Deep Dive (20)

PDF
[WLDN] Supercharging word press development in 2018
Adam Tomat
 
PDF
Terrific Composer Workshop
Remo Brunschwiler
 
KEY
Live Content: Finding new ways to publish
ckimrie
 
PDF
An Introduction to the Laravel Framework (AFUP Forum PHP 2014)
daylerees
 
PDF
Symfony for non-techies
Stefan Koopmanschap
 
PPT
Yii workshop
Simone Gentili
 
PPTX
Migrate yourself. code -> module -> mind
Valentine Matsveiko
 
PPTX
Валентин Мацвейко та Владислав Мойсеєнко — D8: Migrate Yourself: code->module...
LEDC 2016
 
PPTX
CODE IGNITER
Yesha kapadia
 
PDF
What I Learned At Drupal Con Dc 2009
Neil Giarratana
 
PDF
Drupal 8 - What’s cooking?
Alkuvoima
 
PDF
Web Development with Laravel 5
Soheil Khodayari
 
PDF
Advanced symfony Techniques
Kris Wallsmith
 
PDF
symfony_from_scratch
tutorialsruby
 
PDF
symfony_from_scratch
tutorialsruby
 
KEY
Leveraging the Chaos tool suite for module development
zroger
 
PDF
Configuration Kits - DrupalCamp NYC 2021
Martin Anderson-Clutz
 
PDF
Isset Presentation @ EECI2009
Isset Internet Professionals
 
PDF
Drupal 8 - Core and API Changes
Shabir Ahmad
 
PDF
Learning from Happy Lager
alexroper
 
[WLDN] Supercharging word press development in 2018
Adam Tomat
 
Terrific Composer Workshop
Remo Brunschwiler
 
Live Content: Finding new ways to publish
ckimrie
 
An Introduction to the Laravel Framework (AFUP Forum PHP 2014)
daylerees
 
Symfony for non-techies
Stefan Koopmanschap
 
Yii workshop
Simone Gentili
 
Migrate yourself. code -> module -> mind
Valentine Matsveiko
 
Валентин Мацвейко та Владислав Мойсеєнко — D8: Migrate Yourself: code->module...
LEDC 2016
 
CODE IGNITER
Yesha kapadia
 
What I Learned At Drupal Con Dc 2009
Neil Giarratana
 
Drupal 8 - What’s cooking?
Alkuvoima
 
Web Development with Laravel 5
Soheil Khodayari
 
Advanced symfony Techniques
Kris Wallsmith
 
symfony_from_scratch
tutorialsruby
 
symfony_from_scratch
tutorialsruby
 
Leveraging the Chaos tool suite for module development
zroger
 
Configuration Kits - DrupalCamp NYC 2021
Martin Anderson-Clutz
 
Isset Presentation @ EECI2009
Isset Internet Professionals
 
Drupal 8 - Core and API Changes
Shabir Ahmad
 
Learning from Happy Lager
alexroper
 
Ad

More from Digital Surgeons (20)

PDF
Navigating Your Brand Through Covid-19
Digital Surgeons
 
PDF
SVG Animations
Digital Surgeons
 
PDF
CSS Grid
Digital Surgeons
 
PDF
Machine learning
Digital Surgeons
 
PDF
Creating great decks: The Origins, the "Why", and 12 Tips to Make Yours Better.
Digital Surgeons
 
PDF
The Science of Story: How Brands Can Use Storytelling To Get More Customers
Digital Surgeons
 
PDF
In Content Strategy, L.E.S.S. is More
Digital Surgeons
 
PDF
Unlock Your Organization Through Digital Transformation
Digital Surgeons
 
PDF
Radical Candor: No BS, helping your team create better work.
Digital Surgeons
 
PDF
Unlocking Creativity: How to Harness the Powers of Design, Art Direction & Cr...
Digital Surgeons
 
PDF
Fight for Yourself: How to Sell Your Ideas and Crush Presentations
Digital Surgeons
 
PDF
Typecurious: A Typography Crash Course
Digital Surgeons
 
PDF
Better Twitch Broadcasting through Rapid Prototyping & Human Centered Design
Digital Surgeons
 
PDF
How to Stream Video Games: A Primer on Twitch.tv
Digital Surgeons
 
PDF
Art, Meet Copy: A Copywriting Primer for Designers
Digital Surgeons
 
PDF
Creating Powerful Customer Experiences
Digital Surgeons
 
PDF
How to Build a Brand Voice Toolkit
Digital Surgeons
 
PDF
Design Thinking: The one thing that will transform the way you think
Digital Surgeons
 
PDF
What You Need to Know About the Future of Wearable Technology
Digital Surgeons
 
PDF
How YouTube is Drastically Changing the Beauty Industry
Digital Surgeons
 
Navigating Your Brand Through Covid-19
Digital Surgeons
 
SVG Animations
Digital Surgeons
 
Machine learning
Digital Surgeons
 
Creating great decks: The Origins, the "Why", and 12 Tips to Make Yours Better.
Digital Surgeons
 
The Science of Story: How Brands Can Use Storytelling To Get More Customers
Digital Surgeons
 
In Content Strategy, L.E.S.S. is More
Digital Surgeons
 
Unlock Your Organization Through Digital Transformation
Digital Surgeons
 
Radical Candor: No BS, helping your team create better work.
Digital Surgeons
 
Unlocking Creativity: How to Harness the Powers of Design, Art Direction & Cr...
Digital Surgeons
 
Fight for Yourself: How to Sell Your Ideas and Crush Presentations
Digital Surgeons
 
Typecurious: A Typography Crash Course
Digital Surgeons
 
Better Twitch Broadcasting through Rapid Prototyping & Human Centered Design
Digital Surgeons
 
How to Stream Video Games: A Primer on Twitch.tv
Digital Surgeons
 
Art, Meet Copy: A Copywriting Primer for Designers
Digital Surgeons
 
Creating Powerful Customer Experiences
Digital Surgeons
 
How to Build a Brand Voice Toolkit
Digital Surgeons
 
Design Thinking: The one thing that will transform the way you think
Digital Surgeons
 
What You Need to Know About the Future of Wearable Technology
Digital Surgeons
 
How YouTube is Drastically Changing the Beauty Industry
Digital Surgeons
 
Ad

Recently uploaded (20)

PDF
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
PDF
Software Development Methodologies in 2025
KodekX
 
PDF
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
PDF
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
PDF
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
PPTX
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
PPTX
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
PPTX
Introduction to Flutter by Ayush Desai.pptx
ayushdesai204
 
PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
PDF
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
PDF
Doc9.....................................
SofiaCollazos
 
PPTX
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
PDF
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
PDF
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
PPTX
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
PDF
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
PPTX
Agile Chennai 18-19 July 2025 Ideathon | AI Powered Microfinance Literacy Gui...
AgileNetwork
 
PDF
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
Software Development Methodologies in 2025
KodekX
 
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
Introduction to Flutter by Ayush Desai.pptx
ayushdesai204
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
Doc9.....................................
SofiaCollazos
 
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
Agile Chennai 18-19 July 2025 Ideathon | AI Powered Microfinance Literacy Gui...
AgileNetwork
 
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 

CraftCMS 3.x Deep Dive