 cd vendor/bundles/
 git clone https://github.com/Acme/DemoBundle.git
 cd vendor/bundles
 git submodule add https://github.com/Acme/DemoBundle.git
  vendor/bundles/Acme/AcmeDemoBundle
[AcmeDemoBundle]
   git=https://github.com/acme/AcmeDemoBundle.git
   target=/bundles/Acme/AcmeDemoBundle

 php bin/vendors install
[AcmeDemoBundle]
   git=https://github.com/acme/AcmeDemoBundle.git
   target=/bundles/Acme/AcmeDemoBundle

 php bin/vendors install
// app/autoload.php
use SymfonyComponentClassLoaderUniversalClassLoader;

$loader = new UniversalClassLoader();
$loader->registerNamespaces(array(
    ‘Acme'     => __DIR__.'/../vendor/bundles',
));
// app/AppKernel.php
public function registerBundles()
{
   $bundles = array(
      new AcmeDemoBundleAcmeDemoBundle(),
);
// app/config/config.yml

acme_demo:
  foo: bar
/**
 * @Route("/blog")
 * @Cache(expires="tomorrow")
 */
class AnnotController extends Controller
{
   /**
    * @Route("/")
    * @Template
    */
   public function indexAction()
   {
       $posts = ...;

      return array('posts' => $posts);
  }
class MyService
{
   /**
    * @Secure(roles="ROLE_USER, ROLE_FOO, ROLE_ADMIN")
    */
   public function secureMethod()
   {
       // ...
   }
   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
# app/config/routing.yml
users:
 type:   rest
 resource:
  AcmeHelloBundleControllerUsersController
# app/config/config.yml
avalanche_imagine:
  filters:
      my_thumb:
         type: thumbnail
           options: { size: [100, 100], mode: outbound }
{# 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') ?>"
   />
public function testUserFooIndex()
{
    $this->
      loadFixtures(array('LiipFooBundleTestsFixturesLoadUserData'));


    $client = $this->createClient();
    $crawler = $client->request('GET', '/users/foo');



    $this->assertTrue(
      $crawler->filter('html:contains("Email: foo@bar.com")')->count() > 0
       );
}
public function testBasicAuthentication()
{
  $this->
     loadFixtures(array('LiipFooBundleTestsFixturesLoadUserData'));



    $content = $this->fetchContent('/users/foo', 'GET', true);
    $this->assertEquals('Hello foo!', $content);
}
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
Desymfony 2011 - Habemus Bundles
Desymfony 2011 - Habemus Bundles
Desymfony 2011 - Habemus Bundles
Desymfony 2011 - Habemus Bundles
Desymfony 2011 - Habemus Bundles
Desymfony 2011 - Habemus Bundles
Desymfony 2011 - Habemus Bundles
Desymfony 2011 - Habemus Bundles
Desymfony 2011 - Habemus Bundles
Desymfony 2011 - Habemus Bundles
Desymfony 2011 - Habemus Bundles
Desymfony 2011 - Habemus Bundles
Desymfony 2011 - Habemus Bundles
Desymfony 2011 - Habemus Bundles
Desymfony 2011 - Habemus Bundles
Desymfony 2011 - Habemus Bundles
Desymfony 2011 - Habemus Bundles
Desymfony 2011 - Habemus Bundles

Desymfony 2011 - Habemus Bundles

  • 15.
     cd vendor/bundles/ git clone https://github.com/Acme/DemoBundle.git
  • 16.
     cd vendor/bundles git submodule add https://github.com/Acme/DemoBundle.git vendor/bundles/Acme/AcmeDemoBundle
  • 17.
    [AcmeDemoBundle] git=https://github.com/acme/AcmeDemoBundle.git target=/bundles/Acme/AcmeDemoBundle  php bin/vendors install
  • 18.
    [AcmeDemoBundle] git=https://github.com/acme/AcmeDemoBundle.git target=/bundles/Acme/AcmeDemoBundle  php bin/vendors install
  • 20.
    // app/autoload.php use SymfonyComponentClassLoaderUniversalClassLoader; $loader= new UniversalClassLoader(); $loader->registerNamespaces(array( ‘Acme' => __DIR__.'/../vendor/bundles', ));
  • 21.
    // app/AppKernel.php public functionregisterBundles() { $bundles = array( new AcmeDemoBundleAcmeDemoBundle(), );
  • 22.
  • 30.
    /** * @Route("/blog") * @Cache(expires="tomorrow") */ class AnnotController extends Controller { /** * @Route("/") * @Template */ public function indexAction() { $posts = ...; return array('posts' => $posts); }
  • 37.
    class MyService { /** * @Secure(roles="ROLE_USER, ROLE_FOO, ROLE_ADMIN") */ public function secureMethod() { // ... }
  • 44.
    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
  • 54.
    # app/config/routing.yml users: type: rest resource: AcmeHelloBundleControllerUsersController
  • 60.
    # app/config/config.yml avalanche_imagine: filters: my_thumb: type: thumbnail options: { size: [100, 100], mode: outbound }
  • 61.
    {# twig #} <imgsrc="{{ '/relative/path/to/image.jpg' | apply_filter('my_thumb') }}" /> <!– php --> <img src="<?php $this['imagine']->filter('/relative/path/to/image.jpg', 'my_thumb') ?>" />
  • 65.
    public function testUserFooIndex() { $this-> loadFixtures(array('LiipFooBundleTestsFixturesLoadUserData')); $client = $this->createClient(); $crawler = $client->request('GET', '/users/foo'); $this->assertTrue( $crawler->filter('html:contains("Email: [email protected]")')->count() > 0 ); }
  • 66.
    public function testBasicAuthentication() { $this-> loadFixtures(array('LiipFooBundleTestsFixturesLoadUserData')); $content = $this->fetchContent('/users/foo', 'GET', true); $this->assertEquals('Hello foo!', $content); }
  • 68.
    Feature: Addition Inorder 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