symfony: a brief introduction

27
Symfony: A brief introduction

Upload: craig-willis

Post on 15-Jan-2015

1.057 views

Category:

Technology


2 download

DESCRIPTION

Presentation for Leeds PHP User Group - July 2010

TRANSCRIPT

Page 1: Symfony: A Brief Introduction

Symfony: A brief introduction

Page 2: Symfony: A Brief Introduction

Me

PHP Developer @ Teabag Studios Magento, Zend Framework, Symfony

http://www.craig-willis.co.ukhttp://www.twitter.com/craig_willis

Page 3: Symfony: A Brief Introduction

What is Symfony?

PHP MVC Framework RoR, Mohavi Goal

Speed up creation, maintenance/replace repetition

Robust enterprise applications Full control of configuration

Page 4: Symfony: A Brief Introduction

Symfony: History

http://en.wikipedia.org/wiki/Symfony

Page 5: Symfony: A Brief Introduction

Installation

Windows/Mac/Linux Apache, PHP 5, MySQL, mod_rewrite Command Line Interface (CLI)

http://www.symfony-project.org/installation/1_3 SVN: http://svn.symfony-project.com/branches/1.4

Page 6: Symfony: A Brief Introduction

Installation: continued

PHP folder (/usr/share/php/symfony)

Symbolic Link – /usr/bin/

Page 7: Symfony: A Brief Introduction

Installation: continued 2

Multiple versions symfony14 -V, symfony10 -V

Page 8: Symfony: A Brief Introduction

Project Setup CLI

Page 9: Symfony: A Brief Introduction

Project File/Folder Structure

Page 10: Symfony: A Brief Introduction

Frontend/Admin

frontend_dev.php, admin_dev.php Debug Toolbar – symfony 1st to introduce Logging/cache

Page 11: Symfony: A Brief Introduction

http://localhost/craig_app/web/frontend_dev.php

Page 12: Symfony: A Brief Introduction

Models

schema.yml, schema.xml Autogenerate models SQL Fixtures (sample data)

Page 13: Symfony: A Brief Introduction

schema.xml example

Page 14: Symfony: A Brief Introduction

Building models

Page 15: Symfony: A Brief Introduction

Models: continued• StaticPage.php

– object represents single record of static_page

• StaticPagePeer.php

– static methods, collections of StaticPage objects

• BaseStaticPage*

– Autogenerated when re-build model

– Parents of each model file

• Both main (child) classes are empty by default

Page 16: Symfony: A Brief Introduction

Examples

Page 17: Symfony: A Brief Introduction

Actions - Modules

• Index.php, frontend_dev.php → actions

• Create module

Page 18: Symfony: A Brief Introduction

View

• 3 parts

– Action

– View

– Route (optional for URL)actions.class.php indexSuccess.php

Page 19: Symfony: A Brief Introduction

Forms/Validation

Based on Propel/custom Labels, widgets, defaults, validators String, choice, file, boolean....

Page 20: Symfony: A Brief Introduction

Widgets and Validators

Page 21: Symfony: A Brief Introduction

Admin Generator

• Quick/easy admin system

• Modular

• Based on Propel

• 3 Parts

– generator.yml

– actions.class.php

– View tempates (optional)

Page 22: Symfony: A Brief Introduction

Example

Page 23: Symfony: A Brief Introduction

Plugins

• Extend Symfony functionality easily

• Extend existing libraries for Symfony

• More configuration!

Page 24: Symfony: A Brief Introduction

Community

• Forum - http://forum.symfony-project.org

• IRC – Freenode - #symfony

• Google Groups - http://groups.google.com/group/symfony-community

Page 25: Symfony: A Brief Introduction

Applications/Websites

• Yahoo! Bookmarks

• Yahoo! Answers

• DailyMotion

• Delicious

Page 26: Symfony: A Brief Introduction

Where next?

• http://www.symfony-project.org/gentle-introduction/1_4/en/

• Jobeet

– http://www.symfony-project.org/jobeet/1_2/Propel/en/

– http://www.jobeet.org/en/

• IRC/Forum

Page 27: Symfony: A Brief Introduction

Questions?