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
symfony madrid - directorio betabeers
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Betabeers
March 02, 2012
480
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
symfony madrid - directorio betabeers
Betabeers
March 02, 2012
More Decks by Betabeers
See All by Betabeers
Cómo diagnosticar problemas de rendimiento en entornos LAMP @crononito
betabeers
1
140
karmacracy
betabeers
0
130
dogfight
betabeers
0
200
Patrones de diseño y ejemplos prácticos en JAVA @47deg_es
betabeers
0
8.4k
Introducción a REST y ejemplos prácticos con JAVA @47deg_es
betabeers
0
260
Apps móviles, ampliando horizontes
betabeers
0
310
topigames nscoder madrid
betabeers
0
630
AffinityRadar
betabeers
0
190
backbeam
betabeers
0
200
Featured
See All Featured
Become a Pro
speakerdeck
PRO
31
6.2k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
260
Building Flexible Design Systems
yeseniaperezcruz
330
41k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Visualization
eitanlees
152
17k
Thoughts on Productivity
jonyablonski
76
5.3k
Heart Work Chapter 1 - Part 1
lfama
PRO
8
36k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
480
Tell your own story through comics
letsgokoyo
1
1k
YesSQL, Process and Tooling at Scale
rocio
174
15k
HDC tutorial
michielstock
2
820
How to Talk to Developers About Accessibility
jct
2
530
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