Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
An Introduction to Symfony2
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Geoffrey Tran
July 03, 2012
Programming
230
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
An Introduction to Symfony2
A simple introduction to Symfony2 for LoneStarPHP11
Geoffrey Tran
July 03, 2012
More Decks by Geoffrey Tran
See All by Geoffrey Tran
Stop Exposing Yourself: Exploits, Attacks and Defenses
geoff
2
470
Other Decks in Programming
See All in Programming
異なる設計思想のフレームワークを経験して得た学び
amekuhideki
1
300
Oxlintはいいぞ(続)
yug1224
1
410
私のClaude Code活用法 (個人開発編) - PHPerKaigi mini #4(2026/08/24)
panda_program
1
140
レビュー履歴をAIに食わせて、 Compose移行を加速するs
shihochan
0
200
仕様駆動開発へのトライを機に チームに適合する手法を模索し続けている話
freee
PRO
0
600
書籍「プロフェッショナルAI駆動開発」紹介スライド
juntaromatsumoto
0
350
人間の目はかわらない、だからJPEGは30年もつ
yuzneri
12
19k
[PyCon KR 2026] More Variants, More Diversity for AI Accelerators
achimnol
0
110
源内ハンズオン概要編
hideg
0
210
言葉の格闘技のススメ~紙とペンと言葉から始める、キャリアの描き方~
progresscicada
2
170
Japan Community Day at Kubecon + CloudNativeCon Japan 2026: Learning Container Privilege Control by Building My Own Low-Level Container Runtime
ternbusty
1
170
How I Won Prize Money at a Hackathon Using Codex and Symphony Alpha
yasei_no_otoko
0
120
Featured
See All Featured
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
730
Statistics for Hackers
jakevdp
799
230k
Testing 201, or: Great Expectations
jmmastey
46
8.2k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
The agentic SEO stack - context over prompts
schlessera
0
870
Bootstrapping a Software Product
garrettdimon
PRO
306
120k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
3k
Optimizing for Happiness
mojombo
378
71k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
970
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
6.1k
How to Ace a Technical Interview
jacobian
281
24k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
470
Transcript
!Symfony2:!It’s!Play!Time! @geoffreytran! www.linkedin.com/in/geoffreytran!
What!is!Symfony2?! It!simply!solves!your!difficult!redundant!problems! …!and!gets!out!of!your!way!
You!are!not!boxed!in…!
…!easy!to!get!started,!yet!powerful!and!flexible!for! advanced!users!
Pre!Zend_ApplicaNon!Bootstrap! Index.php!
Post!Zend_ApplicaNon! Index.php!
“The core architecture is now stable…” – Fabien Potencier hPp://symfony.com/blog/symfony2QfinalQversionQweQareQnotQthereQyet!
In!development!since!December!2009!
A!lot!can!happen! in!a!year! A"baby?"
None
Top"2%"of"projects"on"Ohloh"
325"Bundles"Published" h>p://symfony2bundles.org/"
What!exactly!is!a!bundle?! A!bundle!is!like!a!plugin! …!except!Symfony2!itself!is!made!up!of!bundles!
“I!was!using!the!same!idea!by!organizing!my!code!in![zend!framework]! modules,!but!this!is!really!painful”! QQ!tawfekov!via!StackOverflow! ! hPp://stackoverflow.com/quesNons/5053369/doQyouQthinkQzendQframeworkQmissesQtheQsymfonysQbundleQprinciple!
Nothing!like!Symfony1!
Less!Magic! config_autoload.yml.php!
Explicit!ConfiguraNon! app/AppKernel.php!
Doctrine2! Doctrine2:!User.php! Doctrine!1.2:!User.php!
Decoupled!design!
None
None
None
None
What makes up Symfony2? ConfiguraNon! Kernel! Directory! Structure! Symfony!Framework!Bundles! Symfony!Components!
Getting started with Symfony2 distributions Similar!to!Linux!distribuNons!
hPp://symfony.com/download!
#!cd!~/Projects/LoneStarPHP! #!tar!xvzf!/path/to/Symfony_Standard_Vendors_2.0.0BETA4.tgz! Extract to your web directory
Check requirements hPp://yourhost/LoneStarPHP/web/config.php! Not!accessing!from!localhost?!! Remove!the!security!check! from:! web/config.php" web/app_dev.php"
Check requirements hPp://yourhost/LoneStarPHP/web/config.php!
Check requirements hPp://yourhost/LoneStarPHP/web/config.php!
Check requirements hPp://yourhost/LoneStarPHP/web/config.php!
Check requirements hPp://yourhost/LoneStarPHP/web/config.php!
Configure the database connection hPp://yourhost/LoneStarPHP/web/app_dev.php/_configurator/step/0! You!can!write!your! own!configuraNon! files!instead!
Yay, Welcome to Symfony! hPp://yourhost/LoneStarPHP/web/app_dev.php!
What!makes!a!page?! /hello/world" A!Route! !/hello/{name}" A!Controller! !A!PHP!funcNon! A!Response! !“<h1>Hello!World!</h1>”!
Step!1:!Create!a!route! /hello/world" File:"app/config/rouKng.yml" ! ! *!RouNng!can!also!be!defined!with!XML,!PHP!and!as!annotaNons! AcmeDemoBundle:LoneStar:hello!! maps!to! !Acme\DemoBundle\Controller\LoneStarController::helloAcNon()!
Step!2:!Create!a!controller! /hello/world" File:"src/Acme/DemoBundle/Controller/LoneStarController.php" ! ! *!At!its!simplest,!a!controller!is!just!a!funcNon!
Step!2:!Create!a!controller! /hello/world" File:"src/Acme/DemoBundle/Controller/LoneStarController.php" ! ! File:"app/config/rouKng.yml" ! !
/hello/world! hPp://yourhost/LoneStarPHP/web/app_dev.php/hello/world!
Great…!! But!HTML!in!controllers?!&@*$%!""
Meet!Twig" hPp://www.twigQproject.org! src/Acme/DemoBundle/Resources/views/LoneStar/hello.html.twig! src/Acme/DemoBundle/Controller/LoneStarController.php!
Hello!World!" hPp://yourhost/LoneStarPHP/web/app_dev.php/hello/world!
Digging!Deeper" hPp://yourhost/LoneStarPHP/web/app_dev.php/hello/world!
Digging!Deeper" hPp://yourhost/LoneStarPHP/web/app_dev.php/hello/world!
Do!less!work! /hello/world" File:"src/Acme/DemoBundle/Controller/LoneStarController.php" ! !
Give"it"a"try…"