SlideShare una empresa de Scribd logo
1 de 51
Descargar para leer sin conexión
/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
Example: Everyday problems
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
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
];
}
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
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 %>
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
];
}
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"));
}
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

Más contenido relacionado

La actualidad más candente

Phantom js quick start
Phantom js quick startPhantom js quick start
Phantom js quick start
ji guang
 

La actualidad más candente (20)

First Step towards WebAssembly with Rust
First Step towards WebAssembly with RustFirst Step towards WebAssembly with Rust
First Step towards WebAssembly with Rust
 
WebAssembly with Rust
WebAssembly with RustWebAssembly with Rust
WebAssembly with Rust
 
Javascript Bundling and modularization
Javascript Bundling and modularizationJavascript Bundling and modularization
Javascript Bundling and modularization
 
Windows azure and linux
Windows azure and linuxWindows azure and linux
Windows azure and linux
 
Improving WordPress Performance with Xdebug and PHP Profiling
Improving WordPress Performance with Xdebug and PHP ProfilingImproving WordPress Performance with Xdebug and PHP Profiling
Improving WordPress Performance with Xdebug and PHP Profiling
 
[Js hcm] Deploying node.js with Forever.js and nginx
[Js hcm] Deploying node.js with Forever.js and nginx[Js hcm] Deploying node.js with Forever.js and nginx
[Js hcm] Deploying node.js with Forever.js and nginx
 
Nuxt로 사내서비스 구현하면서 얻은 경험 공유
Nuxt로 사내서비스 구현하면서 얻은 경험 공유Nuxt로 사내서비스 구현하면서 얻은 경험 공유
Nuxt로 사내서비스 구현하면서 얻은 경험 공유
 
Blazor
BlazorBlazor
Blazor
 
Pre-render Blazor WebAssembly on static web hosting at publishing time
Pre-render Blazor WebAssembly on static web hosting at publishing timePre-render Blazor WebAssembly on static web hosting at publishing time
Pre-render Blazor WebAssembly on static web hosting at publishing time
 
NodeJS Presentation
NodeJS PresentationNodeJS Presentation
NodeJS Presentation
 
Blazor v1.1
Blazor v1.1Blazor v1.1
Blazor v1.1
 
AEM WITH MONGODB
AEM WITH MONGODBAEM WITH MONGODB
AEM WITH MONGODB
 
Bower & Grunt - A practical workflow
Bower & Grunt - A practical workflowBower & Grunt - A practical workflow
Bower & Grunt - A practical workflow
 
Node.JS security
Node.JS securityNode.JS security
Node.JS security
 
Blazor introduction
Blazor introductionBlazor introduction
Blazor introduction
 
An Introduction to Node.js Development with Windows Azure
An Introduction to Node.js Development with Windows AzureAn Introduction to Node.js Development with Windows Azure
An Introduction to Node.js Development with Windows Azure
 
Grunt and Bower
Grunt and BowerGrunt and Bower
Grunt and Bower
 
Florian Koch - Monitoring CoreOS with Zabbix
Florian Koch - Monitoring CoreOS with ZabbixFlorian Koch - Monitoring CoreOS with Zabbix
Florian Koch - Monitoring CoreOS with Zabbix
 
Advanced front-end automation with npm scripts
Advanced front-end automation with npm scriptsAdvanced front-end automation with npm scripts
Advanced front-end automation with npm scripts
 
Phantom js quick start
Phantom js quick startPhantom js quick start
Phantom js quick start
 

Similar a StripeCon EU 2018 - SilverStripe 4 application framework

Cloud Best Practices
Cloud Best PracticesCloud Best Practices
Cloud Best Practices
Eric Bottard
 

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

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

Último

The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 

Último (20)

The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxBUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
 
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verifiedSector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 

StripeCon EU 2018 - SilverStripe 4 application framework