intro to silex

12
How To API With Silex Joey Rivera

Upload: joey-rivera

Post on 21-Feb-2017

467 views

Category:

Presentations & Public Speaking


0 download

TRANSCRIPT

How To API With Silex

Joey Rivera

Me!O Joey Rivera @joeyriveraO Hobbies

O Family LifeO PhpO AngularJSO CarsO Gamer

O Work at Salesforce Pardot

What is it?O Micro-frameworkO Built on symfonyO Great for APIO EASY!

FeaturesO PimpleO Routing

O GET/PUT/POST/DELETE/PATCH/OPTIONSO Middlewares

O Before/after/finishO ServiceProviders

O Twig/security/monolog/doctrineO ControllersO Commands

SetupO Composer

O "silex/silex": "~1.3”O Rewrite rules/.htaccessO Note: $app becomes the DIC

HTTP MethodsO GET/PUT/POST/DELETE/PATCH/

OPTIONS

HTTP Methods Cont.O Real example getting a user:

O GET /users/1

Middleware and Error Handling

O AuthenticationO Error Handling

ServiceProviderO DoctrineORM Exaple

CommandsO DbReset Example

Live Example!

Question?O @joeyriveraO All code at:

O https://github.com/joeyrivera/phpug-silex-intro

O http://silex.sensiolabs.org/