SlideShare uma empresa Scribd logo
1 de 51
Baixar para ler offline
/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

Mais conteúdo relacionado

Mais procurados

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

Mais procurados (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
 

Semelhante a StripeCon EU 2018 - SilverStripe 4 application framework

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

Semelhante 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
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Último (20)

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
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
Pharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodologyPharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodology
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
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
 
%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
 
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
 
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
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
%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
 
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
 
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...
 
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 🔝✔️✔️
 

StripeCon EU 2018 - SilverStripe 4 application framework