Presentation is loading. Please wait.

Presentation is loading. Please wait.

A Pragmatic Look At Symfony (The PHP5 framework) by Darren Beale Skillswap Bristol - 26 th July 2007.

Similar presentations


Presentation on theme: "A Pragmatic Look At Symfony (The PHP5 framework) by Darren Beale Skillswap Bristol - 26 th July 2007."— Presentation transcript:

1 A Pragmatic Look At Symfony (The PHP5 framework) by Darren Beale Skillswap Bristol - 26 th July 2007

2 Who am I?  Front-end & PHP Developer since 1998  Owner/Manager of Siftware Ltd in Upton-upon-Severn  Siftware is 1 yr old & provides outsourced web dev services to design and development agencies  The business thing is starting to interest me more than the tech  Previous to Siftware I spent 8 years in London  4 years as contractor/employee Front-end (inc Flash), PHP, Coldfusion and 1 year as *nix sysadmin  4 years as owner/manager of Exponetic Ltd in Bethnal Green Grew it up to 8 staff then exited It is still going strong  Underscore member all that time, although  I left Bristol within months of subscribing  I don’t post as much as I used to  This is my first meeting, hello! A Pragmatic Look At Symfony (The PHP5 framework) for Skillswap Bristol by Darren Beale

3 What about you? A Pragmatic Look At Symfony (The PHP5 framework) for Skillswap Bristol by Darren Beale  …wave them like you just don’t care  How many of you are techies?  How many do mostly PHP dev?  Do any of you use frameworks?  Symfony?

4 What’s I’ll be covering A Pragmatic Look At Symfony (The PHP5 framework) for Skillswap Bristol by Darren Beale  Why use a framework?  Intro to Symfony  Symfony’s MVC implementation  Coding a simple web application from scratch  Areas for Improvement  Summary  What next?

5 Why use a framework? A Pragmatic Look At Symfony (The PHP5 framework) for Skillswap Bristol by Darren Beale  Factors out common patterns  Code layout  Config  URL routing  Authentication and Security  Form validation  Internationalisation/Localisation  Encourages good design and allows one to easily utilise best practices

6 Intro to Symfony A Pragmatic Look At Symfony (The PHP5 framework) for Skillswap Bristol by Darren Beale  symfony-project.com symfony-project.com  Written in PHP5  Superb documentation  including a couple of sample applications  The book is open source and available online  Forums, wiki, mailing list as one would expect  Lots of plugins including  CMS  Forum  Blog

7 Intro to Symfony cont… A Pragmatic Look At Symfony (The PHP5 framework) for Skillswap Bristol by Darren Beale  Recommended configuration  Apache with mod_rewrite  PHP5.2.x  Simple to install  Pear #> pear channel-discover pear.symfony-project.com #> pear install symfony/symfony  Apache, add alias in your VirtualHost, e.g. Alias /sf /usr/share/php/data/symfony/web/sf

8 Intro to Symfony cont… A Pragmatic Look At Symfony (The PHP5 framework) for Skillswap Bristol by Darren Beale  Minimal dependencies, all included  Creole Database Abstraction Support for MySQL, PostgreSQL, SQLite, MSSQL  Propel Object Relationship Mapping About to officially support Doctrine too but can already use via plugin  PAKE Library for easy command line tasks  LIME Library for easy unit and functional testing  Plus… Prototype Script.aculo.us TinyMCE (WYSIWYG) DynArch.com Rich Calendar

9 Symfony’s MVC implementation A Pragmatic Look At Symfony (The PHP5 framework) for Skillswap Bristol by Darren Beale  Model  Data access and manipulation  Based on Propel (by default)  Built in tools for pagination, sorting and filters  Model can be configured using XML or YAML  Symfony builds your model for you! #> symfony propel-build-model  Symfony provides classes ready for you to extend your model

10 Symfony’s MVC implementation cont… A Pragmatic Look At Symfony (The PHP5 framework) for Skillswap Bristol by Darren Beale  View  Presentation layer  Global layout and configuration Each action can have its own sub template View config can go down as low as actions  Symfony uses PHP as its templating language There’s a Smarty plugin  Partials and Slots Template fragments without business logic  Components Template fragments with business logic

11 Symfony’s MVC implementation cont… A Pragmatic Look At Symfony (The PHP5 framework) for Skillswap Bristol by Darren Beale  Controller  Routes the business logic  Each ‘module’ has a controller class with a number of ‘action’ methods  Automatic conversion of the URL into the appropriate module/action  Pre and post execute methods

12 Lots of coding A Pragmatic Look At Symfony (The PHP5 framework) for Skillswap Bristol by Darren Beale  Lets get our hands dirty  Dev environment is Windows XP (sorry) with Debian server running under VMWare with Apache, PHP, MySQL and Samba  Apache document root is a Samba share mapped as a drive  The app I’m going to build is very simple. I had bigger plans but I de-scoped as I went along

13 Summary A Pragmatic Look At Symfony (The PHP5 framework) for Skillswap Bristol by Darren Beale  We talked about  Why frameworks are A Good Thing  Intro to Symfony  Symfony’s MVC implementation  Coding a simple web application from scratch  Areas for Improvement

14 Areas for Improvement A Pragmatic Look At Symfony (The PHP5 framework) for Skillswap Bristol by Darren Beale  I think Symfony is superb and has got a huge amount going for it  That said, there are a few area that niggle me  Some of the build process is a bit flakey  Well it is for me anyway  Especially around refactoring  Seems a bit magic sometimes  But one could argue that’s the point  Forums and mailing lists are not always particularly helpful  They seem to be more helpful when you know what you’re talking about (e.g. the documentation is already superb, go read that)  Some would argue this as a positive as it leaves the mailing lists free of noise

15 What next? A Pragmatic Look At Symfony (The PHP5 framework) for Skillswap Bristol by Darren Beale  For more information  Symfony-project.com Try the sample application there or Askeet! the 24 day sample project  Feel free to me with questions  I’ll put these slides up on along with the codehttp://bealers.com

16 A Pragmatic Look At Symfony (The PHP5 framework) for Skillswap Bristol by Darren Beale


Download ppt "A Pragmatic Look At Symfony (The PHP5 framework) by Darren Beale Skillswap Bristol - 26 th July 2007."

Similar presentations


Ads by Google