PHP and Ember, a Bronies Paradise

PHP and Ember, a Bronies Paradise

Slides to presentation given at the Utah PHP User Group July 17, 2014

0e2948f19a7dacdf4085d7d33093f260?s=128

Eric Berry

July 17, 2014
Tweet

Transcript

  1. a Bronies Paradise

  2. I tweet at @cavneb @coderberry I blog at coderberry.me I

    commit to github.com/cavneb I work for Instructure I run the EmberSLC meetup Eric Berry
  3. None
  4. A Tale of Two Ponies Act 1.

  5. Rise of the Unicorn • Fork of Sproutcore in 2011

    by Yehuda Katz, Tom Dale and others • Core team includes 10 people (none are paid) • Current version is 1.6.1 • New stable release every 6 weeks.
  6. Core Team Yehuda Katz Tom Dale Peter Wagenet Erik Bryn

    Trek Glowacki Kris Seldon Stefan Penner Leah Silber Robert Jackson Alex Matchneer
  7. Core Team Apple Star Blade Thunder Strong Gunner Defiant Perfection

    Veiled Steel Magical Drop Heroic Fire Radiant Aura Charged Sprout Midnight Rainbow
  8. Goals of Ember • Create ambitious web applications • Become

    more productive out of the box • Write less code • Provide conventions and abstractions Photo by Amy Lombard
  9. None
  10. Learning to Fly Act 2.

  11. Core Concepts • Object • Router • Model • Controller

    • View • Templates Photo by Amy Lombard
  12. Ember.Object http://emberjs.com/guides/object-model/classes-and-instances/ Everything extends Ember.Object

  13. Ember.Object http://emberjs.com/guides/object-model/classes-and-instances/ 1! 2! 3! 4! 5! 6! 7! 8!

    9! 10! 11! 12! 13! 14! 15! 16! 17! 18 App.Pony = Ember.Object.extend({! say: function(thing) {! var name = this.get('name');! alert(name + " says: " + thing);! }! });! ! App.FlyingPony = App.Pony.extend({! say: function(thing) {! this._super(thing + “ down there!");! }! });! ! var as = App.FlyingPony.create({! name: “Apple Star"! });! ! as.say(“Hello"); // alerts “Apple Star says: Hello down there!”!
  14. Application Flow http://emberjs.com/guides/object-model/classes-and-instances/ Request A request is sent to the

    Ember application
  15. Application Flow http://emberjs.com/guides/object-model/classes-and-instances/ Route Request The router determines which route

    to send the request to and the route receives the request and params
  16. Application Flow http://emberjs.com/guides/object-model/classes-and-instances/ Model Route Request The route gathers the

    data from the models, which wrap the data (api calls, etc)
  17. Application Flow http://emberjs.com/guides/object-model/classes-and-instances/ Controller Model Route Request The route then

    places the data on the controller. The controller maintains display-related state.
  18. Application Flow http://emberjs.com/guides/object-model/classes-and-instances/ Controller Model Route Template Request And the

    templates are rendered (having access to the models via the controller)
  19. Application Flow http://emberjs.com/guides/object-model/classes-and-instances/ Controller Model Route Template View Request Views

    are used as a UI abstraction to handle user events (if needed)
  20. Application Flow http://emberjs.com/guides/object-model/classes-and-instances/ Controller Model Route Template View Component Request

    Components can be used in templates to provide a self-contained view, controller and template
  21. Which Way to Fly? Act 3.

  22. Getting Started Photo by Amy Lombard or…

  23. Ember command line utility for ambitious web applications. Ember CLI

    • Generators • Tests • Environment support • Asset compilation via broccoli • ES6 • Dependency management • Community support
  24. Where’s the ???!!!

  25. Live Coding Act 4.

  26. I tweet at @coderberry I blog at coderberry.me I commit

    to github.com/cavneb I work for Instructure I run the EmberSLC meetup