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
1から理解するWeb Push
dora1998
7
1.9k
Kiroで始めるAI-DLC
kaonash
2
600
Azure SRE Agentで運用は楽になるのか?
kkamegawa
0
2.3k
AIコーディングAgentとの向き合い方
eycjur
0
270
意外と簡単!?フロントエンドでパスキー認証を実現する WebAuthn
teamlab
PRO
2
760
AIでLINEスタンプを作ってみた
eycjur
1
230
Navigating Dependency Injection with Metro
zacsweers
3
990
概念モデル→論理モデルで気をつけていること
sunnyone
2
270
テストコードはもう書かない:JetBrains AI Assistantに委ねる非同期処理のテスト自動設計・生成
makun
0
340
Design Foundational Data Engineering Observability
sucitw
3
200
Updates on MLS on Ruby (and maybe more)
sylph01
1
180
Navigation 2 を 3 に移行する(予定)ためにやったこと
yokomii
0
290
Featured
See All Featured
The Straight Up "How To Draw Better" Workshop
denniskardys
236
140k
A designer walks into a library…
pauljervisheath
207
24k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
A Modern Web Designer's Workflow
chriscoyier
696
190k
Facilitating Awesome Meetings
lara
55
6.5k
GraphQLの誤解/rethinking-graphql
sonatard
72
11k
Thoughts on Productivity
jonyablonski
70
4.8k
Unsuck your backbone
ammeep
671
58k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Speed Design
sergeychernyshev
32
1.1k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
44
2.5k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
126
53k
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