$30 off During Our Annual Pro Sale. View Details »
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
MAP, Jigsaw, Code Golf 振り返り会 by 関東Kaggler会|Jigsaw 15th Solution
hasibirok0
0
250
堅牢なフロントエンドテスト基盤を構築するために行った取り組み
shogo4131
8
2.4k
AIコーディングエージェント(Gemini)
kondai24
0
240
関数実行の裏側では何が起きているのか?
minop1205
1
700
チームをチームにするEM
hitode909
0
340
GISエンジニアから見たLINKSデータ
nokonoko1203
0
120
【CA.ai #3】Google ADKを活用したAI Agent開発と運用知見
harappa80
0
320
S3 VectorsとStrands Agentsを利用したAgentic RAGシステムの構築
tosuri13
6
320
リリース時」テストから「デイリー実行」へ!開発マネージャが取り組んだ、レガシー自動テストのモダン化戦略
goataka
0
130
新卒エンジニアのプルリクエスト with AI駆動
fukunaga2025
0
230
これだけで丸わかり!LangChain v1.0 アップデートまとめ
os1ma
6
1.9k
マスタデータ問題、マイクロサービスでどう解くか
kts
0
110
Featured
See All Featured
Code Review Best Practice
trishagee
74
19k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.6k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
359
30k
Mobile First: as difficult as doing things right
swwweet
225
10k
The Pragmatic Product Professional
lauravandoore
37
7.1k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Music & Morning Musume
bryan
46
7k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.3k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.3k
Reflections from 52 weeks, 52 projects
jeffersonlam
355
21k
Being A Developer After 40
akosma
91
590k
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