SlideShare a Scribd company logo
1 of 51
Download to read offline
July 2015 Meetup
www.php.frl / www.meetup.com/PHP-FRL / @PHPFRL
Echo ‘Hello World!’;
www.php.frl / www.meetup.com/PHP-FRL / @PHPFRL
Location Sponsor

Pronamic
www.php.frl / www.meetup.com/PHP-FRL / @PHPFRL
Speaker

Mark Hamstra
Unleashing Creative Freedom with MODX
www.php.frl / www.meetup.com/PHP-FRL / @PHPFRL
Unleashing Creative
Freedom with
Who am I?
Mark Hamstra
Founder & CEA at modmore
Freelance MODX Developer
not me
Turbo
Bommel
Agenda
• What is MODX, for whom, available
features, how to build a MODX site
• Tour of the MODX Manager (back-end)
• The Architecture of MODX, xPDO ORM,
extending and overriding
MOD-what?
MOD-what?
• Open Source
MOD-what?
• Open Source
• Written in PHP (of course)
MOD-what?
• Open Source
• Written in PHP (of course)
• Already 10 years old young
MOD-what?
• Open Source
• Written in PHP (of course)
• Already 10 years old young
• Content Management
System Framework Platform
All the features of a CMS
All the features of a CMS
rich text editor versioning user groups
multisite templates multilingual extensions
markdown media browser hierarchical
page tree commercial support automatic
menu builder blogging permissions seo
friendly urls server-side caching
Out-of-the-box Install
Out-of-the-box Install
Elements as Building Blocks
Templates
TemplateVariables
Chunks
Snippets
Plugins
Templates
• Usually HTML
• Contains MODX tags
• One template per page
Template Variables
• Custom field for resources
• Commonly “TV”
• Tied to templates
• Text, image, select, checkbox,
date, radio, richtext, tag and
custom types available
• [[*name-of-tv]]
Chunks
• Usually HTML
• Reusable piece of code
• [[$name-of-chunk]]
Template
Chunk “head”
Snippets
• PHP!
• Comparable to a function
• Accepts properties
• [[name-of-snippet]] or 

[[!name-of-snippet]]
Snippet “helloWorld”
Template
Snippets
But wait, there’s more!
• [[name-of-snippet]]
• [[!name-of-snippet]]
• = uncached!
• [[++name-of-setting]]

[[!++name-of-setting]]
• [[$name-of-chunk]]

[[!$name-of-chunk]]
• [[*name-of-field]]

[[!*name-of-field]]
But wait, there’s even more!
• [[helloWorld?

&property=`value`

]]
• [[$head?

&extraCss=`<link rel=.. href=..>`

]]
Plugins
• PHP!
• Event-based, so no tags
• Can read and often
influence behaviour
No need to reinvent

the wheel
• Packages (aka extras, add-
ons, extensions, third party
components…) provide
common functionality
• Install via Package Installer
inside the manager
Example: getResources
• Lists resources matching
conditions
• Uses a Chunk as template
• Use Cases:
• Article listings
• Dynamic (sub)menus
• RSS feed generation
Template
Chunk “blogListItem”
Time for a Manager Tour!
http://localhost/tmp/phpfrl/manager/
MODX Architecture
Secure by Design
cve.mitre.org
Secure by Design
• Automatic $_GET, $_POST, $_REQUEST
sanitisation in the request handler
cve.mitre.org
Secure by Design
• Automatic $_GET, $_POST, $_REQUEST
sanitisation in the request handler
• xPDO ORM prevents SQL Injections
cve.mitre.org
Secure by Design
• Automatic $_GET, $_POST, $_REQUEST
sanitisation in the request handler
• xPDO ORM prevents SQL Injections
• 28 CVE entries, 8 since 2014
• WordPress: 906, already ~85 in 2015
• Drupal: 915, already ~120 in 2015
cve.mitre.org
xPDO
xPDO
• Object Relational Bridge / ORM
xPDO
• Object Relational Bridge / ORM
• Open Source (modxcms/xpdo)
xPDO
• Object Relational Bridge / ORM
• Open Source (modxcms/xpdo)
• Extension to PHP’s PDO
xPDO
• Object Relational Bridge / ORM
• Open Source (modxcms/xpdo)
• Extension to PHP’s PDO
• Support for MySQL, sqlsrv (and more)
Fetching a Single Object
$c = 5;
$obj = $modx->getObject(‘modChunk’, $c);
$c2 = array(‘name’ => ‘head’);
$obj = $modx->getObject(‘modChunk’, $c2)
Easy Query Builder
$c = $modx->newQuery(‘modResource’);
$c->where([
‘parent’ => 0,
‘AND:pagetitle:LIKE => ‘%About%’
]);
$matches = $modx->getCollection(‘modResource’, $c);
foreach ($matches as $modResource) { . . . }
Automatic Filtering
$search = $_POST[‘search’];
$c = $modx->newQuery(‘modResource’);
$c->where([
‘introtext:LIKE’ => “%{$search}%”,
]);
$modx->setPlaceholder(‘search’, sanitise($search));
function sanitise($value) { return htmlentities($value,
ENT_QUOTES, ‘UTF-8’); }
👍
⚠
Custom Models with xPDO
Custom Models with xPDO
1. Create an xPDO Package Schema (XML)
2. Use build script to write schema into the actual
model files/classes
3. Register it before use ($modx->addPackage)
4. Use any xPDO method (getObject,
getCollection) on your custom model
xPDO Package Schema - Head
<?xml version="1.0" encoding="UTF-8"?>
<model package="phpfrl"
baseClass="xPDOSimpleObject"
platform="mysql"
defaultEngine="MyISAM"
version="1.1">
xPDO Package Schema - Object
<?xml version="1.0" encoding="UTF-8"?>
<model package=“phpfrl” …
<object class="frlMeetup" table=“meetups”>
.. fields ..
</object>
<object class="frlSpeaker" table=“speakers”> … </object>
</model>
xPDO Package Schema - Fields
<?xml version="1.0" encoding="UTF-8"?>
<model package=“phpfrl” …
<object class="frlMeetup" table=“meetups">
<field 

key="name" 

dbtype="varchar" 

precision="100" 

phptype="string" 

null="false" 

default=“PHP FRL Meetup" />
xPDO Package Schema - Indices
<?xml version="1.0" encoding="UTF-8"?>
<model package=“phpfrl” …
<object class="frlMeetup" table=“meetups">

<field key="name" dbtype=“varchar" …

<field key=“starts_on" dbtype=“datetime"

<field key="name" dbtype=“varchar" …
<index alias="name" name="name" primary="false"
unique="false" type="BTREE">

<column key="name" length="" collation="A" null="false" />

</index>

</object>
xPDO Package Schema - Relations
<?xml version="1.0" encoding="UTF-8"?>
<model package=“phpfrl” baseClass=“xPDOSimpleObject" …
<object class="frlMeetup" table=“meetups">

<field key="name" dbtype=“varchar” …>
<composite alias=“Speakers” class=“frlSpeaker” local=“id” foreign=“meetup”
cardinality=“many” owner=“local” />

</object>
<object class="frlSpeaker" table=“speakers">

<field key="name" dbtype=“varchar” …>

<field key="meetup" dbtype=“int” …>
<aggregate alias=“Meetup” class=“frlMeetup” local=“meetup” foreign=“id”
cardinality=“one” owner=“foreign” />

</object>
xPDO Generated Model
<?php

class frlMeetup extends xPDOSimpleObject {
}
<?php
class frlMeetup_mysql extends frlMeetup {
}
Interacting with that model
$modx->addPackage(‘phpfrl’, ‘/path/to/model/‘);
$c = $modx->newQuery(‘frlMeetup’);

$c->sortby(‘starts_on’, ‘DESC’);

$meetup = $modx->getObject(‘frlMeetup’, $c);
echo ‘De volgende meetup is ‘ . $meetup->name . ‘ en vind plaats op ‘ . $meetup-
>starts_on . ‘. ’;
$speakers = $meetup->getMany(‘Speakers’); // or just $meetup->Speakers

foreach ($speakers as $spegfytaker) {

echo $speaker->name . ‘ zal vertellen over ‘ . $speaker->subject;

}
Interesting links:
• MODX.com => official website
• rtfm.modx.com => official documentation
• github.com/modxcms/revolution => source code
• MODX.today => daily links/articles about MODX
• modmore.com => premium extras for MODX
• https://joind.in/14897 => please leave feedback
Enjoy your Creative Freedom

More Related Content

What's hot

Drupal Security from Drupalcamp Cologne 2009
Drupal Security from Drupalcamp Cologne 2009Drupal Security from Drupalcamp Cologne 2009
Drupal Security from Drupalcamp Cologne 2009Gábor Hojtsy
 
Wordpress development: A Modern Approach
Wordpress development:  A Modern ApproachWordpress development:  A Modern Approach
Wordpress development: A Modern ApproachAlessandro Fiore
 
Drupal theming - a practical approach (European Drupal Days 2015)
Drupal theming - a practical approach (European Drupal Days 2015)Drupal theming - a practical approach (European Drupal Days 2015)
Drupal theming - a practical approach (European Drupal Days 2015)Eugenio Minardi
 
Grok Drupal (7) Theming
Grok Drupal (7) ThemingGrok Drupal (7) Theming
Grok Drupal (7) ThemingPINGV
 
Let's write secure drupal code! - Drupal Camp Pannonia 2019
Let's write secure drupal code! - Drupal Camp Pannonia 2019Let's write secure drupal code! - Drupal Camp Pannonia 2019
Let's write secure drupal code! - Drupal Camp Pannonia 2019Balázs Tatár
 
Short lived immutable servers with masterless puppet
Short lived immutable servers with masterless puppetShort lived immutable servers with masterless puppet
Short lived immutable servers with masterless puppetNeil Millard
 
Build Automation of PHP Applications
Build Automation of PHP ApplicationsBuild Automation of PHP Applications
Build Automation of PHP ApplicationsPavan Kumar N
 
Puppet Camp Phoenix 2015: Managing Files via Puppet: Let Me Count The Ways (B...
Puppet Camp Phoenix 2015: Managing Files via Puppet: Let Me Count The Ways (B...Puppet Camp Phoenix 2015: Managing Files via Puppet: Let Me Count The Ways (B...
Puppet Camp Phoenix 2015: Managing Files via Puppet: Let Me Count The Ways (B...Puppet
 
Ezobject wrapper workshop
Ezobject wrapper workshopEzobject wrapper workshop
Ezobject wrapper workshopKaliop-slide
 
WordPress mit Composer und Git verwalten
WordPress mit Composer und Git verwaltenWordPress mit Composer und Git verwalten
WordPress mit Composer und Git verwaltenWalter Ebert
 
Webinar - Managing Files with Puppet
Webinar - Managing Files with PuppetWebinar - Managing Files with Puppet
Webinar - Managing Files with PuppetOlinData
 
Absolute Beginners Guide to Drupal
Absolute Beginners Guide to DrupalAbsolute Beginners Guide to Drupal
Absolute Beginners Guide to DrupalRod Martin
 
Grok Drupal (7) Theming - 2011 Feb update
Grok Drupal (7) Theming - 2011 Feb updateGrok Drupal (7) Theming - 2011 Feb update
Grok Drupal (7) Theming - 2011 Feb updateLaura Scott
 
Drupal Theme Development - DrupalCon Chicago 2011
Drupal Theme Development - DrupalCon Chicago 2011Drupal Theme Development - DrupalCon Chicago 2011
Drupal Theme Development - DrupalCon Chicago 2011Ryan Price
 
Webinar - Windows Application Management with Puppet
Webinar - Windows Application Management with PuppetWebinar - Windows Application Management with Puppet
Webinar - Windows Application Management with PuppetOlinData
 
ITT 2015 - Simon Stewart - Building Android Apps at Speed and Scale
ITT 2015 - Simon Stewart - Building Android Apps at Speed and ScaleITT 2015 - Simon Stewart - Building Android Apps at Speed and Scale
ITT 2015 - Simon Stewart - Building Android Apps at Speed and ScaleIstanbul Tech Talks
 
Building and deploying PHP applications with Phing
Building and deploying PHP applications with PhingBuilding and deploying PHP applications with Phing
Building and deploying PHP applications with PhingMichiel Rook
 

What's hot (20)

Drupal Security from Drupalcamp Cologne 2009
Drupal Security from Drupalcamp Cologne 2009Drupal Security from Drupalcamp Cologne 2009
Drupal Security from Drupalcamp Cologne 2009
 
Wordpress development: A Modern Approach
Wordpress development:  A Modern ApproachWordpress development:  A Modern Approach
Wordpress development: A Modern Approach
 
Drupal theming - a practical approach (European Drupal Days 2015)
Drupal theming - a practical approach (European Drupal Days 2015)Drupal theming - a practical approach (European Drupal Days 2015)
Drupal theming - a practical approach (European Drupal Days 2015)
 
Grok Drupal (7) Theming
Grok Drupal (7) ThemingGrok Drupal (7) Theming
Grok Drupal (7) Theming
 
Lightweight web frameworks
Lightweight web frameworksLightweight web frameworks
Lightweight web frameworks
 
Let's write secure drupal code! - Drupal Camp Pannonia 2019
Let's write secure drupal code! - Drupal Camp Pannonia 2019Let's write secure drupal code! - Drupal Camp Pannonia 2019
Let's write secure drupal code! - Drupal Camp Pannonia 2019
 
Short lived immutable servers with masterless puppet
Short lived immutable servers with masterless puppetShort lived immutable servers with masterless puppet
Short lived immutable servers with masterless puppet
 
Build Automation of PHP Applications
Build Automation of PHP ApplicationsBuild Automation of PHP Applications
Build Automation of PHP Applications
 
Django
DjangoDjango
Django
 
Puppet Camp Phoenix 2015: Managing Files via Puppet: Let Me Count The Ways (B...
Puppet Camp Phoenix 2015: Managing Files via Puppet: Let Me Count The Ways (B...Puppet Camp Phoenix 2015: Managing Files via Puppet: Let Me Count The Ways (B...
Puppet Camp Phoenix 2015: Managing Files via Puppet: Let Me Count The Ways (B...
 
Ezobject wrapper workshop
Ezobject wrapper workshopEzobject wrapper workshop
Ezobject wrapper workshop
 
WordPress mit Composer und Git verwalten
WordPress mit Composer und Git verwaltenWordPress mit Composer und Git verwalten
WordPress mit Composer und Git verwalten
 
Webinar - Managing Files with Puppet
Webinar - Managing Files with PuppetWebinar - Managing Files with Puppet
Webinar - Managing Files with Puppet
 
Absolute Beginners Guide to Drupal
Absolute Beginners Guide to DrupalAbsolute Beginners Guide to Drupal
Absolute Beginners Guide to Drupal
 
Grok Drupal (7) Theming - 2011 Feb update
Grok Drupal (7) Theming - 2011 Feb updateGrok Drupal (7) Theming - 2011 Feb update
Grok Drupal (7) Theming - 2011 Feb update
 
Drupal Theme Development - DrupalCon Chicago 2011
Drupal Theme Development - DrupalCon Chicago 2011Drupal Theme Development - DrupalCon Chicago 2011
Drupal Theme Development - DrupalCon Chicago 2011
 
Webinar - Windows Application Management with Puppet
Webinar - Windows Application Management with PuppetWebinar - Windows Application Management with Puppet
Webinar - Windows Application Management with Puppet
 
Zend Framework
Zend FrameworkZend Framework
Zend Framework
 
ITT 2015 - Simon Stewart - Building Android Apps at Speed and Scale
ITT 2015 - Simon Stewart - Building Android Apps at Speed and ScaleITT 2015 - Simon Stewart - Building Android Apps at Speed and Scale
ITT 2015 - Simon Stewart - Building Android Apps at Speed and Scale
 
Building and deploying PHP applications with Phing
Building and deploying PHP applications with PhingBuilding and deploying PHP applications with Phing
Building and deploying PHP applications with Phing
 

Similar to Unleashing Creative Freedom with MODX (2015-07-21 @ PHP FRL)

Unleashing Creative Freedom with MODX (2015-09-03 at GroningenPHP)
Unleashing Creative Freedom with MODX (2015-09-03 at GroningenPHP)Unleashing Creative Freedom with MODX (2015-09-03 at GroningenPHP)
Unleashing Creative Freedom with MODX (2015-09-03 at GroningenPHP)Mark Hamstra
 
Ran Mizrahi - Symfony2 meets Drupal8
Ran Mizrahi - Symfony2 meets Drupal8Ran Mizrahi - Symfony2 meets Drupal8
Ran Mizrahi - Symfony2 meets Drupal8Ran Mizrahi
 
Introduction To Drupal
Introduction To DrupalIntroduction To Drupal
Introduction To DrupalLauren Roth
 
Open erp technical_memento_v0.6.3_a4
Open erp technical_memento_v0.6.3_a4Open erp technical_memento_v0.6.3_a4
Open erp technical_memento_v0.6.3_a4openerpwiki
 
Howtobuildyourownframework
HowtobuildyourownframeworkHowtobuildyourownframework
Howtobuildyourownframeworkhazzaz
 
Simplify your professional web development with symfony
Simplify your professional web development with symfonySimplify your professional web development with symfony
Simplify your professional web development with symfonyFrancois Zaninotto
 
Drupal8 for Symfony Developers (PHP Day Verona 2017)
Drupal8 for Symfony Developers (PHP Day Verona 2017)Drupal8 for Symfony Developers (PHP Day Verona 2017)
Drupal8 for Symfony Developers (PHP Day Verona 2017)Antonio Peric-Mazar
 
Quick flask an intro to flask
Quick flask   an intro to flaskQuick flask   an intro to flask
Quick flask an intro to flaskjuzten
 
Php through the eyes of a hoster: PHPNW10
Php through the eyes of a hoster: PHPNW10Php through the eyes of a hoster: PHPNW10
Php through the eyes of a hoster: PHPNW10Combell NV
 
Making the Most of Modern PHP in Drupal 7
Making the Most of Modern PHP in Drupal 7Making the Most of Modern PHP in Drupal 7
Making the Most of Modern PHP in Drupal 7Ryan Szrama
 
OpenERP Technical Memento
OpenERP Technical MementoOpenERP Technical Memento
OpenERP Technical MementoOdoo
 
Gajendra sharma Drupal Module development
Gajendra sharma Drupal Module developmentGajendra sharma Drupal Module development
Gajendra sharma Drupal Module developmentGajendra Sharma
 
Getting started with WordPress development
Getting started with WordPress developmentGetting started with WordPress development
Getting started with WordPress developmentSteve Mortiboy
 
GDG Addis - An Introduction to Django and App Engine
GDG Addis - An Introduction to Django and App EngineGDG Addis - An Introduction to Django and App Engine
GDG Addis - An Introduction to Django and App EngineYared Ayalew
 
Drupal 8 - Core and API Changes
Drupal 8 - Core and API ChangesDrupal 8 - Core and API Changes
Drupal 8 - Core and API ChangesShabir Ahmad
 

Similar to Unleashing Creative Freedom with MODX (2015-07-21 @ PHP FRL) (20)

Unleashing Creative Freedom with MODX (2015-09-03 at GroningenPHP)
Unleashing Creative Freedom with MODX (2015-09-03 at GroningenPHP)Unleashing Creative Freedom with MODX (2015-09-03 at GroningenPHP)
Unleashing Creative Freedom with MODX (2015-09-03 at GroningenPHP)
 
Ran Mizrahi - Symfony2 meets Drupal8
Ran Mizrahi - Symfony2 meets Drupal8Ran Mizrahi - Symfony2 meets Drupal8
Ran Mizrahi - Symfony2 meets Drupal8
 
Codeigniter
CodeigniterCodeigniter
Codeigniter
 
Introduction To Drupal
Introduction To DrupalIntroduction To Drupal
Introduction To Drupal
 
Php intro
Php introPhp intro
Php intro
 
Php intro
Php introPhp intro
Php intro
 
Php intro
Php introPhp intro
Php intro
 
Tornadoweb
TornadowebTornadoweb
Tornadoweb
 
Open erp technical_memento_v0.6.3_a4
Open erp technical_memento_v0.6.3_a4Open erp technical_memento_v0.6.3_a4
Open erp technical_memento_v0.6.3_a4
 
Howtobuildyourownframework
HowtobuildyourownframeworkHowtobuildyourownframework
Howtobuildyourownframework
 
Simplify your professional web development with symfony
Simplify your professional web development with symfonySimplify your professional web development with symfony
Simplify your professional web development with symfony
 
Drupal8 for Symfony Developers (PHP Day Verona 2017)
Drupal8 for Symfony Developers (PHP Day Verona 2017)Drupal8 for Symfony Developers (PHP Day Verona 2017)
Drupal8 for Symfony Developers (PHP Day Verona 2017)
 
Quick flask an intro to flask
Quick flask   an intro to flaskQuick flask   an intro to flask
Quick flask an intro to flask
 
Php through the eyes of a hoster: PHPNW10
Php through the eyes of a hoster: PHPNW10Php through the eyes of a hoster: PHPNW10
Php through the eyes of a hoster: PHPNW10
 
Making the Most of Modern PHP in Drupal 7
Making the Most of Modern PHP in Drupal 7Making the Most of Modern PHP in Drupal 7
Making the Most of Modern PHP in Drupal 7
 
OpenERP Technical Memento
OpenERP Technical MementoOpenERP Technical Memento
OpenERP Technical Memento
 
Gajendra sharma Drupal Module development
Gajendra sharma Drupal Module developmentGajendra sharma Drupal Module development
Gajendra sharma Drupal Module development
 
Getting started with WordPress development
Getting started with WordPress developmentGetting started with WordPress development
Getting started with WordPress development
 
GDG Addis - An Introduction to Django and App Engine
GDG Addis - An Introduction to Django and App EngineGDG Addis - An Introduction to Django and App Engine
GDG Addis - An Introduction to Django and App Engine
 
Drupal 8 - Core and API Changes
Drupal 8 - Core and API ChangesDrupal 8 - Core and API Changes
Drupal 8 - Core and API Changes
 

More from Mark Hamstra

The (Long) Road to Commerce 1.0
The (Long) Road to Commerce 1.0The (Long) Road to Commerce 1.0
The (Long) Road to Commerce 1.0Mark Hamstra
 
Improving the MODX Documentation - March 29, 2019
Improving the MODX Documentation - March 29, 2019Improving the MODX Documentation - March 29, 2019
Improving the MODX Documentation - March 29, 2019Mark Hamstra
 
Commerce in 30 minutes (November 15, 2018 at MODX Meetup Maastricht)
Commerce in 30 minutes (November 15, 2018 at MODX Meetup Maastricht)Commerce in 30 minutes (November 15, 2018 at MODX Meetup Maastricht)
Commerce in 30 minutes (November 15, 2018 at MODX Meetup Maastricht)Mark Hamstra
 
MODX Meetup 2018-03-07 - Introduction talk
MODX Meetup 2018-03-07 - Introduction talk MODX Meetup 2018-03-07 - Introduction talk
MODX Meetup 2018-03-07 - Introduction talk Mark Hamstra
 
Dev, Staging & Production Workflow with Gitify (at MODXpo 2015 in Munich)
Dev, Staging & Production Workflow with Gitify (at MODXpo 2015 in Munich)Dev, Staging & Production Workflow with Gitify (at MODXpo 2015 in Munich)
Dev, Staging & Production Workflow with Gitify (at MODXpo 2015 in Munich)Mark Hamstra
 
Solving the Workflow - Building MODX.today with Gitify (2015-05-21, Alkmaar)
Solving the Workflow - Building MODX.today with Gitify (2015-05-21, Alkmaar)Solving the Workflow - Building MODX.today with Gitify (2015-05-21, Alkmaar)
Solving the Workflow - Building MODX.today with Gitify (2015-05-21, Alkmaar)Mark Hamstra
 
Solving the Workflow (or, how MODX.today is being built with git and Gitify)
Solving the Workflow (or, how MODX.today is being built with git and Gitify)Solving the Workflow (or, how MODX.today is being built with git and Gitify)
Solving the Workflow (or, how MODX.today is being built with git and Gitify)Mark Hamstra
 
MODX Weekend 2014 - Welcome Slides
MODX Weekend 2014 - Welcome SlidesMODX Weekend 2014 - Welcome Slides
MODX Weekend 2014 - Welcome SlidesMark Hamstra
 
MODXpo 2013 - The Business of Premium - Day 2, 14:30
MODXpo 2013 - The Business of Premium - Day 2, 14:30MODXpo 2013 - The Business of Premium - Day 2, 14:30
MODXpo 2013 - The Business of Premium - Day 2, 14:30Mark Hamstra
 

More from Mark Hamstra (9)

The (Long) Road to Commerce 1.0
The (Long) Road to Commerce 1.0The (Long) Road to Commerce 1.0
The (Long) Road to Commerce 1.0
 
Improving the MODX Documentation - March 29, 2019
Improving the MODX Documentation - March 29, 2019Improving the MODX Documentation - March 29, 2019
Improving the MODX Documentation - March 29, 2019
 
Commerce in 30 minutes (November 15, 2018 at MODX Meetup Maastricht)
Commerce in 30 minutes (November 15, 2018 at MODX Meetup Maastricht)Commerce in 30 minutes (November 15, 2018 at MODX Meetup Maastricht)
Commerce in 30 minutes (November 15, 2018 at MODX Meetup Maastricht)
 
MODX Meetup 2018-03-07 - Introduction talk
MODX Meetup 2018-03-07 - Introduction talk MODX Meetup 2018-03-07 - Introduction talk
MODX Meetup 2018-03-07 - Introduction talk
 
Dev, Staging & Production Workflow with Gitify (at MODXpo 2015 in Munich)
Dev, Staging & Production Workflow with Gitify (at MODXpo 2015 in Munich)Dev, Staging & Production Workflow with Gitify (at MODXpo 2015 in Munich)
Dev, Staging & Production Workflow with Gitify (at MODXpo 2015 in Munich)
 
Solving the Workflow - Building MODX.today with Gitify (2015-05-21, Alkmaar)
Solving the Workflow - Building MODX.today with Gitify (2015-05-21, Alkmaar)Solving the Workflow - Building MODX.today with Gitify (2015-05-21, Alkmaar)
Solving the Workflow - Building MODX.today with Gitify (2015-05-21, Alkmaar)
 
Solving the Workflow (or, how MODX.today is being built with git and Gitify)
Solving the Workflow (or, how MODX.today is being built with git and Gitify)Solving the Workflow (or, how MODX.today is being built with git and Gitify)
Solving the Workflow (or, how MODX.today is being built with git and Gitify)
 
MODX Weekend 2014 - Welcome Slides
MODX Weekend 2014 - Welcome SlidesMODX Weekend 2014 - Welcome Slides
MODX Weekend 2014 - Welcome Slides
 
MODXpo 2013 - The Business of Premium - Day 2, 14:30
MODXpo 2013 - The Business of Premium - Day 2, 14:30MODXpo 2013 - The Business of Premium - Day 2, 14:30
MODXpo 2013 - The Business of Premium - Day 2, 14:30
 

Recently uploaded

VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...singhpriety023
 
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...tanu pandey
 
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...tanu pandey
 
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...SUHANI PANDEY
 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtrahman018755
 
APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC
 
Real Escorts in Al Nahda +971524965298 Dubai Escorts Service
Real Escorts in Al Nahda +971524965298 Dubai Escorts ServiceReal Escorts in Al Nahda +971524965298 Dubai Escorts Service
Real Escorts in Al Nahda +971524965298 Dubai Escorts ServiceEscorts Call Girls
 
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersMoving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersDamian Radcliffe
 
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort ServiceEnjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort ServiceDelhi Call girls
 
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.soniya singh
 
Russian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl ServiceRussian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl Servicegwenoracqe6
 
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableCall Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableSeo
 
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.soniya singh
 
Enjoy Night⚡Call Girls Samalka Delhi >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Samalka Delhi >༒8448380779 Escort ServiceEnjoy Night⚡Call Girls Samalka Delhi >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Samalka Delhi >༒8448380779 Escort ServiceDelhi Call girls
 
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLLucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLimonikaupta
 
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...SUHANI PANDEY
 
VVIP Pune Call Girls Mohammadwadi WhatSapp Number 8005736733 With Elite Staff...
VVIP Pune Call Girls Mohammadwadi WhatSapp Number 8005736733 With Elite Staff...VVIP Pune Call Girls Mohammadwadi WhatSapp Number 8005736733 With Elite Staff...
VVIP Pune Call Girls Mohammadwadi WhatSapp Number 8005736733 With Elite Staff...SUHANI PANDEY
 
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.soniya singh
 
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...SUHANI PANDEY
 

Recently uploaded (20)

VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
 
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
 
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
 
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
 
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirt
 
APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53
 
Real Escorts in Al Nahda +971524965298 Dubai Escorts Service
Real Escorts in Al Nahda +971524965298 Dubai Escorts ServiceReal Escorts in Al Nahda +971524965298 Dubai Escorts Service
Real Escorts in Al Nahda +971524965298 Dubai Escorts Service
 
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersMoving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
 
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort ServiceEnjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
 
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
 
Russian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl ServiceRussian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl Service
 
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableCall Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
 
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
 
Enjoy Night⚡Call Girls Samalka Delhi >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Samalka Delhi >༒8448380779 Escort ServiceEnjoy Night⚡Call Girls Samalka Delhi >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Samalka Delhi >༒8448380779 Escort Service
 
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLLucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
 
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
 
VVIP Pune Call Girls Mohammadwadi WhatSapp Number 8005736733 With Elite Staff...
VVIP Pune Call Girls Mohammadwadi WhatSapp Number 8005736733 With Elite Staff...VVIP Pune Call Girls Mohammadwadi WhatSapp Number 8005736733 With Elite Staff...
VVIP Pune Call Girls Mohammadwadi WhatSapp Number 8005736733 With Elite Staff...
 
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
 
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
 

Unleashing Creative Freedom with MODX (2015-07-21 @ PHP FRL)

  • 1. July 2015 Meetup www.php.frl / www.meetup.com/PHP-FRL / @PHPFRL
  • 2. Echo ‘Hello World!’; www.php.frl / www.meetup.com/PHP-FRL / @PHPFRL
  • 3. Location Sponsor
 Pronamic www.php.frl / www.meetup.com/PHP-FRL / @PHPFRL
  • 4. Speaker
 Mark Hamstra
Unleashing Creative Freedom with MODX www.php.frl / www.meetup.com/PHP-FRL / @PHPFRL
  • 6. Who am I? Mark Hamstra Founder & CEA at modmore Freelance MODX Developer not me Turbo Bommel
  • 7. Agenda • What is MODX, for whom, available features, how to build a MODX site • Tour of the MODX Manager (back-end) • The Architecture of MODX, xPDO ORM, extending and overriding
  • 10. MOD-what? • Open Source • Written in PHP (of course)
  • 11. MOD-what? • Open Source • Written in PHP (of course) • Already 10 years old young
  • 12. MOD-what? • Open Source • Written in PHP (of course) • Already 10 years old young • Content Management System Framework Platform
  • 13. All the features of a CMS
  • 14. All the features of a CMS rich text editor versioning user groups multisite templates multilingual extensions markdown media browser hierarchical page tree commercial support automatic menu builder blogging permissions seo friendly urls server-side caching
  • 17. Elements as Building Blocks Templates TemplateVariables Chunks Snippets Plugins
  • 18. Templates • Usually HTML • Contains MODX tags • One template per page
  • 19. Template Variables • Custom field for resources • Commonly “TV” • Tied to templates • Text, image, select, checkbox, date, radio, richtext, tag and custom types available • [[*name-of-tv]]
  • 20. Chunks • Usually HTML • Reusable piece of code • [[$name-of-chunk]] Template Chunk “head”
  • 21. Snippets • PHP! • Comparable to a function • Accepts properties • [[name-of-snippet]] or 
 [[!name-of-snippet]] Snippet “helloWorld” Template
  • 23. But wait, there’s more! • [[name-of-snippet]] • [[!name-of-snippet]] • = uncached! • [[++name-of-setting]]
 [[!++name-of-setting]] • [[$name-of-chunk]]
 [[!$name-of-chunk]] • [[*name-of-field]]
 [[!*name-of-field]]
  • 24. But wait, there’s even more! • [[helloWorld?
 &property=`value`
 ]] • [[$head?
 &extraCss=`<link rel=.. href=..>`
 ]]
  • 25. Plugins • PHP! • Event-based, so no tags • Can read and often influence behaviour
  • 26. No need to reinvent
 the wheel • Packages (aka extras, add- ons, extensions, third party components…) provide common functionality • Install via Package Installer inside the manager
  • 27. Example: getResources • Lists resources matching conditions • Uses a Chunk as template • Use Cases: • Article listings • Dynamic (sub)menus • RSS feed generation Template Chunk “blogListItem”
  • 28. Time for a Manager Tour! http://localhost/tmp/phpfrl/manager/
  • 31. Secure by Design • Automatic $_GET, $_POST, $_REQUEST sanitisation in the request handler cve.mitre.org
  • 32. Secure by Design • Automatic $_GET, $_POST, $_REQUEST sanitisation in the request handler • xPDO ORM prevents SQL Injections cve.mitre.org
  • 33. Secure by Design • Automatic $_GET, $_POST, $_REQUEST sanitisation in the request handler • xPDO ORM prevents SQL Injections • 28 CVE entries, 8 since 2014 • WordPress: 906, already ~85 in 2015 • Drupal: 915, already ~120 in 2015 cve.mitre.org
  • 34. xPDO
  • 36. xPDO • Object Relational Bridge / ORM • Open Source (modxcms/xpdo)
  • 37. xPDO • Object Relational Bridge / ORM • Open Source (modxcms/xpdo) • Extension to PHP’s PDO
  • 38. xPDO • Object Relational Bridge / ORM • Open Source (modxcms/xpdo) • Extension to PHP’s PDO • Support for MySQL, sqlsrv (and more)
  • 39. Fetching a Single Object $c = 5; $obj = $modx->getObject(‘modChunk’, $c); $c2 = array(‘name’ => ‘head’); $obj = $modx->getObject(‘modChunk’, $c2)
  • 40. Easy Query Builder $c = $modx->newQuery(‘modResource’); $c->where([ ‘parent’ => 0, ‘AND:pagetitle:LIKE => ‘%About%’ ]); $matches = $modx->getCollection(‘modResource’, $c); foreach ($matches as $modResource) { . . . }
  • 41. Automatic Filtering $search = $_POST[‘search’]; $c = $modx->newQuery(‘modResource’); $c->where([ ‘introtext:LIKE’ => “%{$search}%”, ]); $modx->setPlaceholder(‘search’, sanitise($search)); function sanitise($value) { return htmlentities($value, ENT_QUOTES, ‘UTF-8’); } 👍 ⚠
  • 43. Custom Models with xPDO 1. Create an xPDO Package Schema (XML) 2. Use build script to write schema into the actual model files/classes 3. Register it before use ($modx->addPackage) 4. Use any xPDO method (getObject, getCollection) on your custom model
  • 44. xPDO Package Schema - Head <?xml version="1.0" encoding="UTF-8"?> <model package="phpfrl" baseClass="xPDOSimpleObject" platform="mysql" defaultEngine="MyISAM" version="1.1">
  • 45. xPDO Package Schema - Object <?xml version="1.0" encoding="UTF-8"?> <model package=“phpfrl” … <object class="frlMeetup" table=“meetups”> .. fields .. </object> <object class="frlSpeaker" table=“speakers”> … </object> </model>
  • 46. xPDO Package Schema - Fields <?xml version="1.0" encoding="UTF-8"?> <model package=“phpfrl” … <object class="frlMeetup" table=“meetups"> <field 
 key="name" 
 dbtype="varchar" 
 precision="100" 
 phptype="string" 
 null="false" 
 default=“PHP FRL Meetup" />
  • 47. xPDO Package Schema - Indices <?xml version="1.0" encoding="UTF-8"?> <model package=“phpfrl” … <object class="frlMeetup" table=“meetups">
 <field key="name" dbtype=“varchar" …
 <field key=“starts_on" dbtype=“datetime"
 <field key="name" dbtype=“varchar" … <index alias="name" name="name" primary="false" unique="false" type="BTREE">
 <column key="name" length="" collation="A" null="false" />
 </index>
 </object>
  • 48. xPDO Package Schema - Relations <?xml version="1.0" encoding="UTF-8"?> <model package=“phpfrl” baseClass=“xPDOSimpleObject" … <object class="frlMeetup" table=“meetups">
 <field key="name" dbtype=“varchar” …> <composite alias=“Speakers” class=“frlSpeaker” local=“id” foreign=“meetup” cardinality=“many” owner=“local” />
 </object> <object class="frlSpeaker" table=“speakers">
 <field key="name" dbtype=“varchar” …>
 <field key="meetup" dbtype=“int” …> <aggregate alias=“Meetup” class=“frlMeetup” local=“meetup” foreign=“id” cardinality=“one” owner=“foreign” />
 </object>
  • 49. xPDO Generated Model <?php
 class frlMeetup extends xPDOSimpleObject { } <?php class frlMeetup_mysql extends frlMeetup { }
  • 50. Interacting with that model $modx->addPackage(‘phpfrl’, ‘/path/to/model/‘); $c = $modx->newQuery(‘frlMeetup’);
 $c->sortby(‘starts_on’, ‘DESC’);
 $meetup = $modx->getObject(‘frlMeetup’, $c); echo ‘De volgende meetup is ‘ . $meetup->name . ‘ en vind plaats op ‘ . $meetup- >starts_on . ‘. ’; $speakers = $meetup->getMany(‘Speakers’); // or just $meetup->Speakers
 foreach ($speakers as $spegfytaker) {
 echo $speaker->name . ‘ zal vertellen over ‘ . $speaker->subject;
 }
  • 51. Interesting links: • MODX.com => official website • rtfm.modx.com => official documentation • github.com/modxcms/revolution => source code • MODX.today => daily links/articles about MODX • modmore.com => premium extras for MODX • https://joind.in/14897 => please leave feedback Enjoy your Creative Freedom