Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
SilverStripe Framework
Building without the CMS
What we’ll cover
Why?! Just why?
What does the CMS take care of for us?
Setting up routes
Handing off to nested controller...
Why would you even...
But the CMS is one of
SilverStripe’s USPs!
Why would you even...
Because:
Quick to get up and running
Easy to define Data Model
Familiarity with framework
Can use existing pipelines and
w...
What does the CMS do?
Takes care of dynamic routing
ModelAsController
Nested routes
Dynamic links to models
Forwarding of ...
So why throw it away?
Speed gains
Reduce bloat
No requirement for managing site structure or content
Highly dynamic pages
Where do we start?
Routing
Routing
Config system for routing
mysite/_config/routes.yml
Define routes to controllers
Before/After?
Before = LOWER prio...
Routing
Handling requests on the Controller
Extra params won’t be removed
Params are parsed when they match
We can create ...
Putting it into practice
A Todo App!
Nested controllers
Nested controllers
Delegating to nested controllers
Prevent creating GOD controllers
Single purpose controllers!
Flexibili...
Flexibility
Instead of:
Flexibility
We can do:
Routing through nested controllers
GET /todo/1/task/9/delete HTTP/1.1
Host: example.com
...
todo matches ListController
1/...
Add some logic to pull out the current List
Put it all together...
Sprinkle some fairy dust
We have ourselves a todo list app
What about administration?
CRUD out of the box?
Framework comes with the admin module
CMS extends Admin
Most projects/apps need SOME sort of CRUD interface
Save yourself ...
CRUD out of the box?
Framework comes with the admin module
CMS extends Admin
Most projects/apps need SOME sort of CRUD interface
Save yourself ...
What did we learn?
Everything else stays the same
Define your
Routes
Controllers
Models
Relationships
Views
or… just build a to-do list app
Thanks
github.com/dhensby/todo-list
@dhensby (everywhere!!)
SilverStripe Framework - Building without the CMS
SilverStripe Framework - Building without the CMS
SilverStripe Framework - Building without the CMS
SilverStripe Framework - Building without the CMS
SilverStripe Framework - Building without the CMS
SilverStripe Framework - Building without the CMS
SilverStripe Framework - Building without the CMS
Upcoming SlideShare
Loading in …5
×

SilverStripe Framework - Building without the CMS

749 views

Published on

Building without the SilverStripe CMS can be useful when you don't need full website management tools. Learn how to go about building a web-app with just the SilverStripe Framework

Published in: Technology
  • Be the first to comment

  • Be the first to like this

SilverStripe Framework - Building without the CMS

  1. 1. SilverStripe Framework Building without the CMS
  2. 2. What we’ll cover Why?! Just why? What does the CMS take care of for us? Setting up routes Handing off to nested controllers What about a CRUD* interface?
  3. 3. Why would you even... But the CMS is one of SilverStripe’s USPs!
  4. 4. Why would you even...
  5. 5. Because: Quick to get up and running Easy to define Data Model Familiarity with framework Can use existing pipelines and workflows User management out-of-the-box Access control / security Modules!
  6. 6. What does the CMS do? Takes care of dynamic routing ModelAsController Nested routes Dynamic links to models Forwarding of old URLs SiteTree Pages Logical hierarchy and menus
  7. 7. So why throw it away? Speed gains Reduce bloat No requirement for managing site structure or content Highly dynamic pages
  8. 8. Where do we start?
  9. 9. Routing
  10. 10. Routing Config system for routing mysite/_config/routes.yml Define routes to controllers Before/After? Before = LOWER priority After = HIGHER priority
  11. 11. Routing Handling requests on the Controller Extra params won’t be removed Params are parsed when they match We can create some nice “RESTful” URIs
  12. 12. Putting it into practice
  13. 13. A Todo App!
  14. 14. Nested controllers
  15. 15. Nested controllers Delegating to nested controllers Prevent creating GOD controllers Single purpose controllers! Flexibility to be used anywhere
  16. 16. Flexibility Instead of:
  17. 17. Flexibility We can do:
  18. 18. Routing through nested controllers GET /todo/1/task/9/delete HTTP/1.1 Host: example.com ... todo matches ListController 1/task/9/delete is passed to ListController 1/task matches task action 9/delete is passed to TaskController
  19. 19. Add some logic to pull out the current List
  20. 20. Put it all together...
  21. 21. Sprinkle some fairy dust
  22. 22. We have ourselves a todo list app
  23. 23. What about administration?
  24. 24. CRUD out of the box?
  25. 25. Framework comes with the admin module CMS extends Admin Most projects/apps need SOME sort of CRUD interface Save yourself building an admin interface! User management / permissions out of the box The admin (not CMS)
  26. 26. CRUD out of the box?
  27. 27. Framework comes with the admin module CMS extends Admin Most projects/apps need SOME sort of CRUD interface Save yourself building an admin interface! User management / permissions out of the box The admin (not CMS)
  28. 28. What did we learn?
  29. 29. Everything else stays the same Define your Routes Controllers Models Relationships Views
  30. 30. or… just build a to-do list app
  31. 31. Thanks github.com/dhensby/todo-list @dhensby (everywhere!!)

×