SlideShare a Scribd company logo
StripeCon EU 2018 - SilverStripe 4 application framework
/me
●
Web based business applications
●
Technology agnostic
●
PHP, Python, NodeJS, React,
●
Silverstripe, Laravel, Django
●
More consultant than developer
Criteria for frameworks
●
Results fast!
●
Incremental development
●
Simple but extensible structure
●
Stability: Static and dynamic
Framework Features
●
ORM
●
Admin Scaffolding
●
Integrated security
●
Form generation, scaffolding
StripeCon EU 2018 - SilverStripe 4 application framework
Example: Everyday problems
StripeCon EU 2018 - SilverStripe 4 application framework
Installation: Init
●
Prerequisites: PHP 7.2, composer
> mkdir monsters
> cd monsters
> composer init
Minimum Stability []: dev
Package Type []: project
License []: BSD-3-Clause
“prefer-stable”: true
Installation: Recipe
# Important to do now!
> mkdir public
# Base recipe
> composer require silverstripe/recipe-core
# Admin
> composer require silverstripe/admin
# File handling
> composer require silverstripe/asset-admin
...large output...
Installation: Confg fles
# .env
SS_DATABASE_CLASS="MySQLPDODatabase"
SS_DATABASE_SERVER="localhost"
SS_DATABASE_USERNAME="root"
SS_DATABASE_PASSWORD="root"
SS_DATABASE_NAME="monsters"
SS_DEFAULT_ADMIN_USERNAME="admin"
SS_DEFAULT_ADMIN_PASSWORD="admin"
SS_ENVIRONMENT_TYPE="dev"
> vendor/bin/sake dev/build
# .gitignore
/.env
/vendor/
/silverstripe-cache/
/public/resources/
/public/assets/*
/.idea
StripeCon EU 2018 - SilverStripe 4 application framework
StripeCon EU 2018 - SilverStripe 4 application framework
StripeCon EU 2018 - SilverStripe 4 application framework
StripeCon EU 2018 - SilverStripe 4 application framework
StripeCon EU 2018 - SilverStripe 4 application framework
StripeCon EU 2018 - SilverStripe 4 application framework
StripeCon EU 2018 - SilverStripe 4 application framework
StripeCon EU 2018 - SilverStripe 4 application framework
StripeCon EU 2018 - SilverStripe 4 application framework
ModelAdmin
app/src/controllers/MonsterController.php
<?php
namespace AppAdmin;
use SilverStripeAdminModelAdmin;
use AppModelsMonster;
class MonsterAdmin extends ModelAdmin {
private static $url_segment = "monsters";
private static $menu_title = "Monsters";
private static $menu_priority = 1;
private static $managed_models = [
Monster::class
];
}
StripeCon EU 2018 - SilverStripe 4 application framework
StripeCon EU 2018 - SilverStripe 4 application framework
StripeCon EU 2018 - SilverStripe 4 application framework
StripeCon EU 2018 - SilverStripe 4 application framework
StripeCon EU 2018 - SilverStripe 4 application framework
The Controller
app/src/controllers/MonsterController.php
<?php
namespace AppControllers;
use SilverStripeControlController;
class MonsterController extends Controller {
}
Routing
app/_confg/routes.yml
---
Name: approutes
After: framework/_config/routes#coreroutes
---
SilverStripeControlDirector:
rules:
'monsters//$Action/$ID': AppControllersMonsterController
'': AppControllersMonsterController
StripeCon EU 2018 - SilverStripe 4 application framework
The View
app/src/controllers/
MonsterController.php
use SilverStripeControlController;
use AppModelsMonster;
class MonsterController extends Controller {
public function index($request)
{
return [
'Title' => 'Monsters',
'Objects' => Monster::get()
];
}
}
app/templates/App/Controllers/
MonsterController.ss
<h1 class="title">$Title</h1>
<% if $Monsters %>
<div class="columns">
<% loop $Monsters %>
<div class="column is-one-third">
<div class="box">
$Image.Fill(300, 200)
<p>$Name</p>
</div>
</div>
<% end_loop %>
</div>
<% end_if %>
StripeCon EU 2018 - SilverStripe 4 application framework
StripeCon EU 2018 - SilverStripe 4 application framework
StripeCon EU 2018 - SilverStripe 4 application framework
StripeCon EU 2018 - SilverStripe 4 application framework
StripeCon EU 2018 - SilverStripe 4 application framework
StripeCon EU 2018 - SilverStripe 4 application framework
StripeCon EU 2018 - SilverStripe 4 application framework
StripeCon EU 2018 - SilverStripe 4 application framework
StripeCon EU 2018 - SilverStripe 4 application framework
StripeCon EU 2018 - SilverStripe 4 application framework
StripeCon EU 2018 - SilverStripe 4 application framework
Frontend editing!
●
German: DAU
●
Feel at home (branding)
●
Everyday tasks
●
Uncommon tasks
As simple as possible
Editing
app/src/controllers/MonsterController.php
class MonsterController extends Controller {
private static $allowed_actions = [
"edit",
"EditForm"
];
public function EditForm() {…}
public function edit(HTTPRequest $request) {}
public function save(array $data, Form $form) {}
}
Editing
app/src/controllers/MonsterController.php:EditForm()
$colors = Monster::singleton()->dbObject('Color')->enumValues();
$fields = FieldList::create(
TextField::create("Name", "Name"),
TextField::create("Eyes", "Number of eyes"),
DropdownField::create("Color", "Main color", $colors),
FileField::create("Image", "Image"),
HiddenField::create("ID", "ID")
);
$actions = FieldList::create(
FormAction::create('save','Save')->addExtraClass('is-primary')
);
$validator = RequiredFields::create('Name');
Editing
app/src/controllers/MonsterController.php
public function edit(HTTPRequest $request) {
$form = $this->EditForm();
$monster = null;
if($id = (int) $request->param("ID")) {
$monster = Monster::get()->byID($id);
$form->loadDataFrom($monster);
}
return [
'Monster' => $monster,
'Form' => $form
];
}
StripeCon EU 2018 - SilverStripe 4 application framework
StripeCon EU 2018 - SilverStripe 4 application framework
StripeCon EU 2018 - SilverStripe 4 application framework
Editing
app/src/controllers/MonsterController.php
public function save(array $data, Form $form) {
if($id = $data["ID"]) {
$monster = Monster::get()->byID($id);
} else {
$monster = Monster::create();
}
$form->saveInto($monster);
$monster->write();
$this->redirect($this->Link("view/$monster->ID"));
}
StripeCon EU 2018 - SilverStripe 4 application framework
SilverStripe as Framework
●
Batteries included
– Versioning, Translations, Extensions, REST
●
Admin
●
Very fast development cycle (dev/build)
●
Confguration not always transparent
●
SilverStripe 4 was a big step
StripeCon EU 2018 - SilverStripe 4 application framework

More Related Content

PDF
twMVC#44 如何測試與保護你的 web application with playwright
KEY
Nodejs web,db,hosting
PPTX
#2 Hanoi Magento Meetup - Part 2: Knockout JS
PDF
Horizontally Scaling Node.js and WebSockets
PPTX
Web development using nodejs
PDF
Server Side Apocalypse, JS
PDF
Build your first DApp using Substrate Framework - Part I
PPTX
Meet Magento Spain 2019 - Our Experience with Magento Cloud
twMVC#44 如何測試與保護你的 web application with playwright
Nodejs web,db,hosting
#2 Hanoi Magento Meetup - Part 2: Knockout JS
Horizontally Scaling Node.js and WebSockets
Web development using nodejs
Server Side Apocalypse, JS
Build your first DApp using Substrate Framework - Part I
Meet Magento Spain 2019 - Our Experience with Magento Cloud

What's hot (20)

PDF
First Step towards WebAssembly with Rust
PDF
WebAssembly with Rust
PPTX
Javascript Bundling and modularization
PDF
Windows azure and linux
PDF
Improving WordPress Performance with Xdebug and PHP Profiling
PDF
[Js hcm] Deploying node.js with Forever.js and nginx
PDF
Nuxt로 사내서비스 구현하면서 얻은 경험 공유
PPTX
PDF
Pre-render Blazor WebAssembly on static web hosting at publishing time
PPTX
NodeJS Presentation
PPTX
PPTX
AEM WITH MONGODB
PDF
Bower & Grunt - A practical workflow
PPT
Node.JS security
PDF
Blazor introduction
KEY
An Introduction to Node.js Development with Windows Azure
PPTX
Grunt and Bower
PDF
Florian Koch - Monitoring CoreOS with Zabbix
PDF
Advanced front-end automation with npm scripts
PDF
Phantom js quick start
First Step towards WebAssembly with Rust
WebAssembly with Rust
Javascript Bundling and modularization
Windows azure and linux
Improving WordPress Performance with Xdebug and PHP Profiling
[Js hcm] Deploying node.js with Forever.js and nginx
Nuxt로 사내서비스 구현하면서 얻은 경험 공유
Pre-render Blazor WebAssembly on static web hosting at publishing time
NodeJS Presentation
AEM WITH MONGODB
Bower & Grunt - A practical workflow
Node.JS security
Blazor introduction
An Introduction to Node.js Development with Windows Azure
Grunt and Bower
Florian Koch - Monitoring CoreOS with Zabbix
Advanced front-end automation with npm scripts
Phantom js quick start
Ad

Similar to StripeCon EU 2018 - SilverStripe 4 application framework (20)

PPTX
#3 Hanoi Magento Meetup - Part 2: Scalable Magento Development With Containers
PDF
Grunt.js and Yeoman, Continous Integration
PDF
Profiling PHP with Xdebug / Webgrind
PDF
Container Security - Let's see Falco and Sysdig in Action by Stefan Trimborn
PDF
Comment améliorer le quotidien des Développeurs PHP ?
PPTX
PhoneGap Day 2016 EU: Creating the Ideal Cordova Dev Environment
PDF
Cloud Best Practices
PDF
What makes me "Grunt"?
PDF
DCSF 19 Building Your Development Pipeline
PPTX
Craft CMS: Beyond the Small Business; Advanced tools and configurations
PDF
Write php deploy everywhere tek11
PDF
Running MongoDB Enterprise on Kubernetes
PDF
Continuous Delivery com Docker, OpenShift e Jenkins
PDF
Ansible Automation to Rule Them All
PDF
Continuous integration / continuous delivery
PDF
Automating complex infrastructures with Puppet
PDF
Improving qa on php projects
PDF
Automating Complex Setups with Puppet
PPTX
drupal ci cd concept cornel univercity.pptx
#3 Hanoi Magento Meetup - Part 2: Scalable Magento Development With Containers
Grunt.js and Yeoman, Continous Integration
Profiling PHP with Xdebug / Webgrind
Container Security - Let's see Falco and Sysdig in Action by Stefan Trimborn
Comment améliorer le quotidien des Développeurs PHP ?
PhoneGap Day 2016 EU: Creating the Ideal Cordova Dev Environment
Cloud Best Practices
What makes me "Grunt"?
DCSF 19 Building Your Development Pipeline
Craft CMS: Beyond the Small Business; Advanced tools and configurations
Write php deploy everywhere tek11
Running MongoDB Enterprise on Kubernetes
Continuous Delivery com Docker, OpenShift e Jenkins
Ansible Automation to Rule Them All
Continuous integration / continuous delivery
Automating complex infrastructures with Puppet
Improving qa on php projects
Automating Complex Setups with Puppet
drupal ci cd concept cornel univercity.pptx
Ad

Recently uploaded (20)

PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PPTX
Transform Your Business with a Software ERP System
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
System and Network Administration Chapter 2
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
top salesforce developer skills in 2025.pdf
PDF
medical staffing services at VALiNTRY
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PPTX
Introduction to Artificial Intelligence
PPTX
ai tools demonstartion for schools and inter college
PDF
AI in Product Development-omnex systems
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Transform Your Business with a Software ERP System
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
Which alternative to Crystal Reports is best for small or large businesses.pdf
How to Choose the Right IT Partner for Your Business in Malaysia
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
2025 Textile ERP Trends: SAP, Odoo & Oracle
System and Network Administration Chapter 2
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
top salesforce developer skills in 2025.pdf
medical staffing services at VALiNTRY
wealthsignaloriginal-com-DS-text-... (1).pdf
Wondershare Filmora 15 Crack With Activation Key [2025
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Introduction to Artificial Intelligence
ai tools demonstartion for schools and inter college
AI in Product Development-omnex systems
Navsoft: AI-Powered Business Solutions & Custom Software Development

StripeCon EU 2018 - SilverStripe 4 application framework