ajax and symfony

7
symfony, AJAX and me you Dave Dash Spindrop LLC Minneapolis USA Dave Dash // Spindrop.us // 2007 September 7 * Beginners track: Ajax + symfony * Whos used symfony/other frameworks/ajax? Whos a novice? * Who can tell us what Ajax is? * AJAX makes web pages more responsive by exchanging small amounts of data with server behind the scenes * interactions are recorded quickly * AJAX is secretly DRY (=

Upload: dave-dash

Post on 05-Jul-2015

3.523 views

Category:

Technology


1 download

DESCRIPTION

Presentation slides used at symfonycamp I'll try to integrate notes into these when I get a chance. Feel free to email me ;)

TRANSCRIPT

Page 1: Ajax and symfony

symfony, AJAX and me you

Dave DashSpindrop LLC

Minneapolis USA

Dave Dash // Spindrop.us // 2007 September 7* Beginner’s track: Ajax + symfony* Who’s used symfony/other frameworks/ajax? Who’s a novice?* Who can tell us what Ajax is?* AJAX makes web pages more responsive by exchanging small amounts of data with server behind the scenes* interactions are recorded quickly* AJAX is secretly DRY (=

Page 2: Ajax and symfony

don’t repeat yourself. don’t repeat yourself. don’t

repeat yourself. don’t repeat yourself. don’t repeat

yourself. don’t repeat yourself. don’t repeat yourself.

don’t repeat yourself. don’t repeat yourself. don’t

repeat yourself. don’t repeat yourself. don’t repeat

yourself. don’t repeat yourself. don’t repeat yourself.

don’t repeat yourself. don’t repeat yourself. don’t

repeat yourself. don’t repeat yourself. don’t repeat

yourself. don’t repeat yourself. don’t repeat yourself.

don’t repeat yourself. don’t repeat yourself. don’t

repeat yourself. don’t repeat yourself. don’t repeat

yourself. don’t repeat yourself. don’t repeat yourself.

don’t repeat yourself. don’t repeat yourself. don’t

repeat yourself. don’t repeat yourself. don’t repeat

yourself. don’t repeat yourself. don’t repeat yourself.

don’t repeat yourself. don’t repeat yourself. don’t

repeat yourself. don’t repeat yourself. don’t repeat

yourself. don’t repeat yourself. don’t repeat yourself.

don’t repeat yourself. don’t repeat yourself. don’t

repeat yourself. don’t repeat yourself. don’t repeat

yourself. don’t repeat yourself. don’t repeat yourself.

don’t repeat yourself. don’t repeat yourself. don’t

repeat yourself. don’t repeat yourself. don’t repeat

yourself. don’t repeat yourself.

D R

Y

* coders don’t repeat self, we use DRY, we make functions to do work that’s been done already* server should be no different, why re-serve content again. Just sent what needs updating* how revolutionary!* AJAX instrumental to my introduction to symfony* 2 years ago Gmaps API caught my attention

Page 3: Ajax and symfony

As easy as riding a bike

* Google Maps API * I started biking (not like Amsterdam in Minneapolis)* Bike Routing over Google Maps* AJAX interactions to retrieve/set the route coordinates* Soon, digg posted a tutorial about creating a digg like interactions using a PHP framework

Page 4: Ajax and symfony

* creating a digg like interactions* This was my gateway to the askeet tutorial for symfony and I was sold immediately* AJAX has been around a while* Gmail, g-apps made it very popular, pushed envelope* Open to a whole new world* Digg meaningless w/o AJAX* 849 people aren’t going to wait for a form to submit* Cope with info-overload.* Many articles to digg!* Increase in responsiveness/usability opens door to new features/apps * star-raters * getting a perspective into web2.0 users mind* web apps > collection of database driven modules/actions* each page fully featured interactive tools * pull/push data as needed* Francois suggested we can turn pages into static and using AJAX to populate the dynamic parts* Questions?

Page 5: Ajax and symfony

Steps

symfony and AJAX* AJAX manually = slow* sf bundled with Prototype/Script.aculo.us* helpers?* helpers make AJAX in symfony easier* coding consistent = no JS required* AJAX Javascript Helpers in symfony mostly work in four steps * There is an object * It has an event * The event triggers an AJAX call * The response usually replaces the content of a target div.* There's plenty of useful variations on this theme pattern

DEMO!

Page 6: Ajax and symfony

* Everything so far relies on Prototype and Script.aculo.us* Some of us don’t like being boxed in.

Page 7: Ajax and symfony

boxed in?* symfony does not box you in.* helpers, bundling libs are great* prototype/script.aculo.us no for everyone * jQuery, YUI (like Dustin in the other talk), mooTools, dojo* lots of good libraries, more than one way to * sf is decoupled, dependencies are minimal if any. * even the ORM swappable* As for using other libraries, you can find plugins to do your job, and if none exist Fabien tomorrow will show you how to write your own.* all it takes is writing a helper and bundling the library and you can be prototype free in no time.* Don't go home thinking you have to learn proto/scrip* any more questions, or demos?