Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Desymfony 2011 - Habemus Bundles

Desymfony 2011 - Habemus Bundles

Avatar for Albert Jessurum

Albert Jessurum

July 07, 2011

More Decks by Albert Jessurum

Other Decks in Programming

Transcript

  1. /** * @Route("/blog") * @Cache(expires="tomorrow") */ class AnnotController extends Controller

    { /** * @Route("/") * @Template */ public function indexAction() { $posts = ...; return array('posts' => $posts); }
  2.  php app/console doctrine:migrations:diff  php app/console doctrine:migrations:execute  php

    app/console doctrine:migrations:generate  php app/console doctrine:migrations:migrate  php app/console doctrine:migrations:status  php app/console doctrine:migrations:version
  3. {# twig #} <img src="{{ '/relative/path/to/image.jpg' | apply_filter('my_thumb') }}" />

    <!– php --> <img src="<?php $this['imagine']->filter('/relative/path/to/image.jpg', 'my_thumb') ?>" />
  4. public function testUserFooIndex() { $this-> loadFixtures(array('Liip\FooBundle\Tests\Fixtures\LoadUserData')); $client = $this->createClient(); $crawler

    = $client->request('GET', '/users/foo'); $this->assertTrue( $crawler->filter('html:contains("Email: [email protected]")')->count() > 0 ); }
  5. Feature: Addition In order to avoid silly mistakes As a

    math idiot I want to be told the sum of two numbers Scenario: Add two numbers Given I have entered 50 into the calculator And I have entered 70 into the calculator When I press add Then The result should be 120 on the screen