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
Developing Web Apps with Symfony2, Doctrine and...
Search
Amal Raghav
October 26, 2012
Programming
4
230
Developing Web Apps with Symfony2, Doctrine and MongoDB
Amal Raghav
October 26, 2012
Tweet
Share
Other Decks in Programming
See All in Programming
QAフローを最適化し、品質水準を満たしながらリリースまでの期間を最短化する #RSGT2026
shibayu36
2
4.4k
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
590
AtCoder Conference 2025
shindannin
0
1.1k
今から始めるClaude Code超入門
448jp
8
8.9k
HTTPプロトコル正しく理解していますか? 〜かわいい猫と共に学ぼう。ฅ^•ω•^ฅ ニャ〜
hekuchan
2
690
プロダクトオーナーから見たSOC2 _SOC2ゆるミートアップ#2
kekekenta
0
220
360° Signals in Angular: Signal Forms with SignalStore & Resources @ngLondon 01/2026
manfredsteyer
PRO
0
130
Best-Practices-for-Cortex-Analyst-and-AI-Agent
ryotaroikeda
1
110
疑似コードによるプロンプト記述、どのくらい正確に実行される?
kokuyouwind
0
390
CSC307 Lecture 10
javiergs
PRO
1
660
AI Schema Enrichment for your Oracle AI Database
thatjeffsmith
0
310
そのAIレビュー、レビューしてますか? / Are you reviewing those AI reviews?
rkaga
6
4.6k
Featured
See All Featured
The agentic SEO stack - context over prompts
schlessera
0
640
Fireside Chat
paigeccino
41
3.8k
How GitHub (no longer) Works
holman
316
140k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
120
Code Reviewing Like a Champion
maltzj
527
40k
Documentation Writing (for coders)
carmenintech
77
5.3k
Rails Girls Zürich Keynote
gr2m
96
14k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
830
A Soul's Torment
seathinner
5
2.3k
jQuery: Nuts, Bolts and Bling
dougneiner
65
8.4k
Transcript
Developing Web Apps with Symfony2, Doctrine and MongoDB Friday, 26
October 12
Who Am I? •Software Engineer at TechJini Solutions •Working with
PHP/Symfony for last 4 years •@kertz on Twitter and Github Friday, 26 October 12
The Whys? •Why Symfony2? •Why Doctrine? Friday, 26 October 12
Symfony2 •Made of reusable components •A community that built Doctrine,
Behat, Composer, Assetic and more •The backbone for future versions of Drupal & phpBB Friday, 26 October 12
Doctrine •Highly configurable •Supports MySQL, PgSQL, Oracle, SQlite, MongoDB and
CouchDB •Doctrine Query Language Friday, 26 October 12
Installation • Composer Dependency Manager (http:// getcomposer.org) $ curl -s
http://getcomposer.org/installer | php $ php composer.phar create-project symfony/framework- standard-edition sf-mongo 2.1.x-dev Friday, 26 October 12
Adding MongoDB { "require": { "doctrine/mongodb-odm-bundle": "3.0.*" }, "minimum-stability": "dev"
} $ composer.phar update doctrine/mongodb-odm-bundle composer.json AppKernel.php Friday, 26 October 12
Configuration doctrine_mongodb: connections: default: server: mongodb://localhost:27017 options: {} default_database: sfmongo
document_managers: default: auto_mapping: true config.yml Friday, 26 October 12
Bundles •Why Bundles? •Creating your own bundles $ app/console generate:bundle
Friday, 26 October 12
Register Bundles AppKernel.php Friday, 26 October 12
What are we building? •A simple image sharing app •Store/Retrieve
images in/from GridFS •Allow comments for images Friday, 26 October 12
Image.php The Document schema for images Friday, 26 October 12
ImageController.php Controller for uploading images Friday, 26 October 12
new.html.twig The template for uploading images Friday, 26 October 12
ImageController.php Retrieving the images Friday, 26 October 12
In Retrospect •A form to upload an image and add
caption •Store images in MongoDB with GridFS •Retrieve images •That was quick, wasn’t it? Friday, 26 October 12
Comment.php The Document schema for comments Friday, 26 October 12
Image.php Add a reference to comments Friday, 26 October 12
ImageController.php Controller for comments Friday, 26 October 12
ImageController.php comments.html.twig Viewing comments for images Friday, 26 October 12
In Retrospect (again) •Allow comments for image •Show comments for
images by id Friday, 26 October 12
Repositories & DQL • Create custom repositories • Using Doctrine
Query Builder Friday, 26 October 12
CommentRepository.php Repository for comments Friday, 26 October 12
Set repository location Comment.php Friday, 26 October 12
CommentController.php Calling Repository functions Friday, 26 October 12
Bundles to watch •SonataAdminBundle http://github.com/sonata-project/SonataAdminBundle •FOSUserBundle http://github.com/FriendsOfSymfony/FOSUserBundle •FOQElasticaBundle http://github.com/Exercise/FOQElasticaBundle Friday,
26 October 12
The End. Questions? Friday, 26 October 12