Download - Symfony2 and Ror3 friends for an hour
![Page 1: Symfony2 and Ror3 friends for an hour](https://reader033.vdocuments.net/reader033/viewer/2022052410/554bb176b4c905b8618b5a66/html5/thumbnails/1.jpg)
S!"f#$! 2&
R#R 3Fr%&$'( f#r )$ *#+r
Monday, June 20, 2011
![Page 2: Symfony2 and Ror3 friends for an hour](https://reader033.vdocuments.net/reader033/viewer/2022052410/554bb176b4c905b8618b5a66/html5/thumbnails/2.jpg)
A,&(()$'r# C%$&,,%S)$'r# P)-)$#..%
A,b&r.# B)rr%,à
Monday, June 20, 2011
![Page 3: Symfony2 and Ror3 friends for an hour](https://reader033.vdocuments.net/reader033/viewer/2022052410/554bb176b4c905b8618b5a66/html5/thumbnails/3.jpg)
Brescia - 24 settembre 2011
Monday, June 20, 2011
![Page 4: Symfony2 and Ror3 friends for an hour](https://reader033.vdocuments.net/reader033/viewer/2022052410/554bb176b4c905b8618b5a66/html5/thumbnails/4.jpg)
Why this speech?Agenda
Join the f***ing cooonf
W*! .*%( (p&&/*?A-&$')
J#%$ .*& f***%$- /###$f
Monday, June 20, 2011
![Page 5: Symfony2 and Ror3 friends for an hour](https://reader033.vdocuments.net/reader033/viewer/2022052410/554bb176b4c905b8618b5a66/html5/thumbnails/5.jpg)
come utente anonimo voglio poter vedere l'elenco delle conferenze ordinate per data decrescentecome ua e ur voglio poter vedere l'elenco delle presentazioni di una conferenza ordinate in data crescentecome ua e ur voglio porer vedere il dettaglio di una presenzationecome ua voglio potermi registrarecome ur voglio poter aderire ad una conferenzacome ur voglio poter commentare una conferenzacome ur voglio poter commentare una presentazione
Monday, June 20, 2011
![Page 6: Symfony2 and Ror3 friends for an hour](https://reader033.vdocuments.net/reader033/viewer/2022052410/554bb176b4c905b8618b5a66/html5/thumbnails/6.jpg)
http://joinconf.heroku.com https://github.com/cirpo/joinconf
only Firefox 4 and Chrome 10+https://github.com/sandropaganoti/joinconf
Monday, June 20, 2011
![Page 7: Symfony2 and Ror3 friends for an hour](https://reader033.vdocuments.net/reader033/viewer/2022052410/554bb176b4c905b8618b5a66/html5/thumbnails/7.jpg)
R#R 3• Thank you Trygve Reenskaug• Thank you Matz• Thank you DHH
Monday, June 20, 2011
![Page 8: Symfony2 and Ror3 friends for an hour](https://reader033.vdocuments.net/reader033/viewer/2022052410/554bb176b4c905b8618b5a66/html5/thumbnails/8.jpg)
R+b! #$ R)%,( Ar/*%.&/.+r&
web server
rack stackmiddleware 1
...
middleware N View
ModelActionControllerMiddlewareStack
Controller.new.process(action)
run Joinconf::Application.routesrequestresponse
Monday, June 20, 2011
![Page 9: Symfony2 and Ror3 friends for an hour](https://reader033.vdocuments.net/reader033/viewer/2022052410/554bb176b4c905b8618b5a66/html5/thumbnails/9.jpg)
S!"f#$! 2• Thank you RoR• Thank you Fabien• Thank you Doctrine• Thank you Spring• Thank you Cocoa
Monday, June 20, 2011
![Page 10: Symfony2 and Ror3 friends for an hour](https://reader033.vdocuments.net/reader033/viewer/2022052410/554bb176b4c905b8618b5a66/html5/thumbnails/10.jpg)
S!"f#$!2 Ar/*%.&/.+r&View
Model
request
response
Kernel
DI
Event Dispatcher
Bundle*
Monday, June 20, 2011
![Page 11: Symfony2 and Ror3 friends for an hour](https://reader033.vdocuments.net/reader033/viewer/2022052410/554bb176b4c905b8618b5a66/html5/thumbnails/11.jpg)
S.)/0• Rack• Event Driven
Monday, June 20, 2011
![Page 12: Symfony2 and Ror3 friends for an hour](https://reader033.vdocuments.net/reader033/viewer/2022052410/554bb176b4c905b8618b5a66/html5/thumbnails/12.jpg)
<services> <service id="fos_user.controller.user" class="%fos_user.controller.user.class%"> <call method="setContainer"> <argument type="service" id="service_container" /> </call> <tag name="security.secure_service" /> </service> <service id="fos_user.controller.security" class="%fos_user.controller.security.class%"> <call method="setContainer"> <argument type="service" id="service_container" /> </call> </service> </services>
Monday, June 20, 2011
![Page 13: Symfony2 and Ror3 friends for an hour](https://reader033.vdocuments.net/reader033/viewer/2022052410/554bb176b4c905b8618b5a66/html5/thumbnails/13.jpg)
services: ideato.joinconf.admin.talk: class: Ideato\DunlopBundle\Admin\NewsAdmin tags: - { name: sonata.admin, manager_type: orm, group: Donlup News, label: News } arguments: [null, Ideato\DunlopBundle\Entity\News, IdeatoDunlopBundle:NewsAdmin]
Monday, June 20, 2011
![Page 14: Symfony2 and Ror3 friends for an hour](https://reader033.vdocuments.net/reader033/viewer/2022052410/554bb176b4c905b8618b5a66/html5/thumbnails/14.jpg)
namespace Ideato\JoinConfBundle\DataFixtrues\ORM;
use Doctrine\Common\DataFixtures\FixtureInterface;use Symfony\Component\DependencyInjection\ContainerInterface;use Symfony\Component\DependencyInjection\ContainerAwareInterface;
class UserFixtures implements FixtureInterface, ContainerAwareInterface {
private $container;
public function setContainer(ContainerInterface $container = null) { $this->container = $container; }
public function load($manager) {
$creator = $this->container->get('fos_user.user_creator'); $creator->create("Ideato", "Ideato", "[email protected]", false, true); $creator->create("odracci", "odracci", "[email protected]", false, true); $creator->create("alberto.barrila", "suka", "[email protected]", false, true); $creator->create("sandro.paganotti", "suka", "[email protected]", false, true);
Monday, June 20, 2011
![Page 15: Symfony2 and Ror3 friends for an hour](https://reader033.vdocuments.net/reader033/viewer/2022052410/554bb176b4c905b8618b5a66/html5/thumbnails/15.jpg)
S!"f#$!
Stacke.g.: Symfony\Component\HttpKernel
onCoreRequestonCoreExceptiononCoreViewonCoreControlleronCoreResponse
Monday, June 20, 2011
![Page 16: Symfony2 and Ror3 friends for an hour](https://reader033.vdocuments.net/reader033/viewer/2022052410/554bb176b4c905b8618b5a66/html5/thumbnails/16.jpg)
R#+.&(always tell your mama
before you go off somewhere!
Monday, June 20, 2011
![Page 17: Symfony2 and Ror3 friends for an hour](https://reader033.vdocuments.net/reader033/viewer/2022052410/554bb176b4c905b8618b5a66/html5/thumbnails/17.jpg)
R)%,( resources :conferences do resources :comments resources :sessions do resources :comments end resources :attendees end
Monday, June 20, 2011
![Page 18: Symfony2 and Ror3 friends for an hour](https://reader033.vdocuments.net/reader033/viewer/2022052410/554bb176b4c905b8618b5a66/html5/thumbnails/18.jpg)
Symfony_welcome: pattern: / defaults: { _controller: 'IdeatoJoinConfBundle:Homepage:index' }
conference: pattern: /conference/{slug} defaults: { _controller: 'IdeatoJoinConfBundle:Blog:show', slug: 1 } requirements: page: \d+
Monday, June 20, 2011
![Page 19: Symfony2 and Ror3 friends for an hour](https://reader033.vdocuments.net/reader033/viewer/2022052410/554bb176b4c905b8618b5a66/html5/thumbnails/19.jpg)
M#'+,)r%.!• Routes to Rack and Engines• Bundles
Monday, June 20, 2011
![Page 20: Symfony2 and Ror3 friends for an hour](https://reader033.vdocuments.net/reader033/viewer/2022052410/554bb176b4c905b8618b5a66/html5/thumbnails/20.jpg)
C#$.r#,,&rclass ConferencesController < ApplicationController def index @conferences = Conference.all respond_with @conferences end def show @conference = Conference.find(params[:id]) endend
Monday, June 20, 2011
![Page 21: Symfony2 and Ror3 friends for an hour](https://reader033.vdocuments.net/reader033/viewer/2022052410/554bb176b4c905b8618b5a66/html5/thumbnails/21.jpg)
C#$.r#,,&r• Function • Object method• Closure
Monday, June 20, 2011
![Page 22: Symfony2 and Ror3 friends for an hour](https://reader033.vdocuments.net/reader033/viewer/2022052410/554bb176b4c905b8618b5a66/html5/thumbnails/22.jpg)
namespace Ideato\JoinConfBundle\Controller;
use Ideato\JoinConfBundle\Entity\Conference;use Symfony\Bundle\FrameworkBundle\Controller\Controller;
class HomepageController extends Controller {
public function indexAction() { $conference_repository = $this->get('doctrine.orm.entity_manager') ->getRepository('IdeatoJoinConfBundle:Conference'); $conferences = $conference_repository ->retrieveConferencesByAscendingOrder();
return $this->render( ('IdeatoJoinConfBundle:Default:index.html.twig', array('conferences' => $conferences));
C#$.r#,,&r
Monday, June 20, 2011
![Page 23: Symfony2 and Ror3 friends for an hour](https://reader033.vdocuments.net/reader033/viewer/2022052410/554bb176b4c905b8618b5a66/html5/thumbnails/23.jpg)
M#'&,• Doctrine 2• POPO• DataMapper• ODM
Monday, June 20, 2011
![Page 24: Symfony2 and Ror3 friends for an hour](https://reader033.vdocuments.net/reader033/viewer/2022052410/554bb176b4c905b8618b5a66/html5/thumbnails/24.jpg)
namespace Ideato\JoinConfBundle\Entity;
/** * @orm:Entity(repositoryClass="Ideato\JoinConfBundle\Repositories\ConferenceRepository") */class Conference {
/** * @orm:Id * @orm:Column(type="integer") * @orm:GeneratedValue(strategy="AUTO") */ private $id; /** * @orm:Column(type="string", length="255") */ private $title; /** * @orm:Column(type="datetime") */ private $date;
M#'&,
Monday, June 20, 2011
![Page 25: Symfony2 and Ror3 friends for an hour](https://reader033.vdocuments.net/reader033/viewer/2022052410/554bb176b4c905b8618b5a66/html5/thumbnails/25.jpg)
namespace Ideatp\JoinConfBundle\Entity;
/** * @orm:Entity(repositoryClass="Cirpo\JoinConfBundle\Repositories\SessionRepository") */class Talk {
/** * @orm:Id * @orm:Column(type="integer") * @orm:GeneratedValue(strategy="AUTO") */ private $id; /** * @orm:Column(type="string", length="255") */ private $title; /** * @ORM\OneToMany(targetEntity="User", mappedBy="talk") */ private $speakers;
M#'&,
Monday, June 20, 2011
![Page 26: Symfony2 and Ror3 friends for an hour](https://reader033.vdocuments.net/reader033/viewer/2022052410/554bb176b4c905b8618b5a66/html5/thumbnails/26.jpg)
M#'&,class Conference < ActiveRecord::Base validates :name, :start, :end, :users_max,
:location, :presence => true default_scope :order => "start DESC" has_many :sessions has_many :attendees has_many :comments, :as => :commentable end
Monday, June 20, 2011
![Page 27: Symfony2 and Ror3 friends for an hour](https://reader033.vdocuments.net/reader033/viewer/2022052410/554bb176b4c905b8618b5a66/html5/thumbnails/27.jpg)
M#'&,• ActiveModel• Arel• ActiveResource
Monday, June 20, 2011
![Page 28: Symfony2 and Ror3 friends for an hour](https://reader033.vdocuments.net/reader033/viewer/2022052410/554bb176b4c905b8618b5a66/html5/thumbnails/28.jpg)
V%&w• Twig• Plain PHP• Assetic
Monday, June 20, 2011
![Page 29: Symfony2 and Ror3 friends for an hour](https://reader033.vdocuments.net/reader033/viewer/2022052410/554bb176b4c905b8618b5a66/html5/thumbnails/29.jpg)
View{% if loop.index is not divisibleby(3) %}
{{ post.published_at|date("m/d/Y") }}
{{ "I like %this% and %that%."|replace({'%this%': foo, '%that%': "bar"}) }}
{{ var.foo|default('foo item on var is not defined') }}{{ var is even }}{{ var is odd }}{% if foo.attribute is sameas(false) %}{% for i in range(0, 3) %}
Monday, June 20, 2011
![Page 30: Symfony2 and Ror3 friends for an hour](https://reader033.vdocuments.net/reader033/viewer/2022052410/554bb176b4c905b8618b5a66/html5/thumbnails/30.jpg)
V%&w<section id="conferences"> <h1><%= I18n.t(:conference_list)%></h1> <%= render @conferences %></section>
<article class="conference"> <header> <h1><%= conference.name %></h1> <dl> <!-- some stuff --> </dl> </header> <p><%= conference.description %></p> <footer> <menu> <li><%= link_to I18n.t(:view_the_sessions ),
conference_sessions_path(conference)%></li> <!-- other links --> </menu> </footer></article>
Monday, June 20, 2011
![Page 31: Symfony2 and Ror3 friends for an hour](https://reader033.vdocuments.net/reader033/viewer/2022052410/554bb176b4c905b8618b5a66/html5/thumbnails/31.jpg)
V%&w• ERb• HTML 5• CoffeScript• SASS
Monday, June 20, 2011
![Page 32: Symfony2 and Ror3 friends for an hour](https://reader033.vdocuments.net/reader033/viewer/2022052410/554bb176b4c905b8618b5a66/html5/thumbnails/32.jpg)
T&(.
Monday, June 20, 2011
![Page 33: Symfony2 and Ror3 friends for an hour](https://reader033.vdocuments.net/reader033/viewer/2022052410/554bb176b4c905b8618b5a66/html5/thumbnails/33.jpg)
Monday, June 20, 2011
![Page 34: Symfony2 and Ror3 friends for an hour](https://reader033.vdocuments.net/reader033/viewer/2022052410/554bb176b4c905b8618b5a66/html5/thumbnails/34.jpg)
Any Questions ????
Monday, June 20, 2011
![Page 35: Symfony2 and Ror3 friends for an hour](https://reader033.vdocuments.net/reader033/viewer/2022052410/554bb176b4c905b8618b5a66/html5/thumbnails/35.jpg)
[email protected] /@cirpo [email protected] /@sandropaganotti
[email protected] /@albertobarrila
S# ,#$-, )$'.*)$0( f#r ),, .*& 1(*
Monday, June 20, 2011