Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
symfony madrid - directorio betabeers
Betabeers
March 02, 2012
0
390
symfony madrid - directorio betabeers
Betabeers
March 02, 2012
Tweet
Share
More Decks by Betabeers
See All by Betabeers
Cómo diagnosticar problemas de rendimiento en entornos LAMP @crononito
betabeers
1
86
karmacracy
betabeers
0
81
dogfight
betabeers
0
76
Patrones de diseño y ejemplos prácticos en JAVA @47deg_es
betabeers
0
8.2k
Introducción a REST y ejemplos prácticos con JAVA @47deg_es
betabeers
0
180
Apps móviles, ampliando horizontes
betabeers
0
150
topigames nscoder madrid
betabeers
0
370
AffinityRadar
betabeers
0
71
backbeam
betabeers
0
79
Featured
See All Featured
Debugging Ruby Performance
tmm1
67
11k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
318
19k
A designer walks into a library…
pauljervisheath
199
16k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
182
15k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
270
12k
The Invisible Side of Design
smashingmag
292
48k
Automating Front-end Workflow
addyosmani
1351
200k
The Illustrated Children's Guide to Kubernetes
chrisshort
22
43k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
13
5.4k
Documentation Writing (for coders)
carmenintech
51
2.9k
Large-scale JavaScript Application Architecture
addyosmani
499
110k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
657
120k
Transcript
Directorio Betabeers 5 meses | 613 commits | 2342 redbulls
@miquelcamps
Eduardo Gulias ¡Gracias por los 20 commits!
Estructura - Pajas mentales con symfony - Entorno de trabajo,
Bundles, Bloques, integración bootstrap.io - Chapuzas - Métricas - Gamificación - Capturas backoffice - Cosas por hacer
¿Por qué symfony? - Lo conocí en la php conference
barcelona - No tenía experiencia con frameworks - Proyectos ya lo usan en producción producción (ulabox,facultia) - Comunidad - Documentación
Lo que me gusta 1- Actualización de tablas app/console doctrine:schema:update
--force 2- Generador app/console generate:bundle 3- Estructura de ficheros 4- Twig y los bloques 5- Comunidad
No me gusta 1- Tamaño 2- Error al editar un
controlador
php app/console cache:clear
None
Entorno de trabajo local --> github --> producción
Entorno de trabajo 1- local (mac + mamp + sublimetext2
+ redbull) 2- commit github (github client mac) http://github.com/miquelcamps/directoriopro 3- pull servidor dedicado kemsirve.es (linux ubuntu) Comando mágico git pull;rm -rf app/cache/prod/;mkdir app/cache/prod;chmod 777 app/cache/prod
Bundles De terceros Pagerfanta de Pablo Díez @pablodip https://github.com/whiteoctober/Pagerfanta Propios
Anuncios User Event Place Test Api City Project
Bloques Layout /AnunciosBundle/Resources/views/layout.html.twig <html> <head> <title>{% block title %}{% endblock
%} - {{sitename}}</title> {% if canonical_url is defined %}<link rel="canonical" href="{{ canonical_url }}"/>{% endif %} </head> <body> <!--header--> {% block content %}{% endblock %} {% block sidebar %}{% endblock %} <!--footer--> {% block load_src %}{% endblock %} {% block script_load %}{% endblock %} </body> </html>
Bloques sección /AnunciosBundle/Resources/views/Post/index.html.twig {% extends "ApplicationAnunciosBundle::layout.html.twig" %} {% block title
"Bolsa de empleo 2.0" %} {% block sidebar %}bla bla{% endblock %} {% block content %}bla bla{% endblock %} {% block load_src %}bla bla{% endblock %} {% block script_load %}bla bla{% endblock %}
Integración bootstrap.io Estáticos /web/ -> ficheros Template layout /AnunciosBundle/Resources/views/layout.html.twig Template
form /AnunciosBundle/Resources/views/Form/fields.html.twig /AnunciosBundle/Resources/views/Post/new.html.twig
Integrar bootstrap.io en formularios $form = $this->createForm(new LoginType(), $entity); $form['pass']->addError(
new SymfonyForm\FormError( "La contraseña no es correcta" ));
Integrar bootstrap.io en formularios {% form_theme form 'ApplicationAnunciosBundle:Form:fields.html.twig' %} <form
class="form-horizontal" action="x" method="post" > {{ form_row(form.email, { 'label': 'Email' }) }} <div class="form-actions"> <button type="submit" class="btn btn-primary">Crear cuenta</button> </div> {{ form_row(form._token) }} </form>
Chapuzas - facebook connect No he podido hacer funcionar FOS
(friends of symfony) 1- login facebook fbloginAction() /src/Application/UserBundle/ 2- se require del ejemplo de facebook /vendor/facebook/example.php https://github.com/facebook/php-sdk
Chapuzas - URLs bonitas /post/86/show --> /post/esto-es-una-prueba-9/ urls en twig
{{ path('post_show', { 'id': entity.id, 'slug': entity.slug }) }} controller action 1 @Route("/{id}/show", name="post_show2") $this->redirect($this->generateUrl('post_show', array('id' => $entity->getID(), 'slug' => $entity->getSlug() )),301); controller action 2 @Route("/{slug}-{id}/", requirements={"slug" = "[a-z0-9\-]+", "id" = "^\d+$"}, name="post_show") layout {% if canonical_url is defined %} <link rel="canonical" href="{{ canonical_url }}"/> {% endif %}
Métricas Contabilizar visitas $session = $this->getRequest()->getSession(); $session_id = $session->get('id'); if(
$session_id != $entity->getUserId() ){ $entity->setVisits( $entity->getVisits() + 1 ); $em->persist($entity); $em->flush(); } Geolocalización geonames.org (country_id, city_id) Dashboard (totales generales) Google Analytics analizar que busca el usuario https://support.google.com/analytics/bin/answer.py?hl=es&answer=1012264
Gamificación Captar nuevos usuarios
Gamificación
Gamificación
Gamificación Obligar el usuario a rellenar perfil
Dashboard
Backoffice anuncios
Backoffice usuarios
Cosas por hacer... - Optimizar queries (likes) y cacheo -
Internacionalización - Hacer autoescalable mover a phpfog - Mejorar seo (sitemaps, urls bonitas)
Megacracks de symfony @egulias @raulfraile @nacmartin @ricardclau @Osukaru80 @moisesgallego
¡Gracias! Posts de como empezar: http://miquelcamps.com/symfony/ Repositorio betabeers: http://github.com/miquelcamps/directoriopro Twitter
@miquelcamps