• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Slim RedBeanPHP and Knockout
 

Slim RedBeanPHP and Knockout

on

  • 1,982 views

Slides from the talk at http://www.meetup.com/GTA-PHP-User-Group-Toronto/events/151672182/

Slides from the talk at http://www.meetup.com/GTA-PHP-User-Group-Toronto/events/151672182/

Source code for the demo at https://github.com/zymsys/Slim-RedBeanPHP-KnockoutJS

Statistics

Views

Total Views
1,982
Views on SlideShare
1,977
Embed Views
5

Actions

Likes
0
Downloads
6
Comments
0

1 Embed 5

https://twitter.com 5

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Slim RedBeanPHP and Knockout Slim RedBeanPHP and Knockout Presentation Transcript

    • Knockout.js With Minimal PHP by Vic Metcalfe
    • Minimal Framework Slim is 3.2MB Symfony is 50MB
    • Minimal Framework <?php $app = new SlimSlim(); $app->get('/hello/:name', function ($name) { echo "Hello, $name"; }); $app->run();
    • Minimal ORM 325K B RedBeanPHP is 8.8MB Doctrine is 9.2MB
    • Minimal ORM $post = R::dispense('post'); $post->text = 'Hello World'; $id = R::store($post); //Create or Update $post = R::load('post',$id); //Retrieve R::trash($post); //Delete
    • Minimal JavaScript Knockout is 46KB Angular is 100KB
    • Minimal JavaScript
    • Symfony Doctrine Angular
    • No MVC G Sh ou ld G Sh ou ld p p View View En ds U sU End M odel M odel o UI o Domain Logic Controller Controller
    • Slim: Git R’ Done Authentication? Content Negotiation? Middleware Middleware Massage Input Data? Page Generation! Content Negotiation? Decoration? Caching?
    • Knockout: MVVM Model M odel View View ViewModel ViewM odel How your PHP represents your data HTML with data-bind attributes Two way binding of data and UI
    • The Demo
    • Knockout is Testable JavaScript! • ViewModel must be a class • Sinon is helpful for testing AJAX
    • Slim is Testable! • Create your own App class • Create an invoke method: public function invoke() { $this->middleware[0]->call(); $this->response()->finalize(); return $this->response(); }
    • RedBeanPHP is almost Testable! • Use in-memory sqlite: public function setUp() { R::setup('sqlite::memory:'); require('seed.php'); } public function tearDown() { R::close(); }
    • Thanks Y’All! • Demo source available at: https://github.com/zymsys/Slim-RedBeanPHP-KnockoutJS • I rarely tweet @v_metcalfe • I even more rarely blog: http://blog.vicmetcalfe.com/