SlideShare ist ein Scribd-Unternehmen logo
1 von 86
Downloaden Sie, um offline zu lesen
 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

Weitere ähnliche Inhalte

Was ist angesagt?

Web+GISという視点から見たGISの方向性
Web+GISという視点から見たGISの方向性Web+GISという視点から見たGISの方向性
Web+GISという視点から見たGISの方向性
Hidenori Fujimura
 
優しいWAFの作り方
優しいWAFの作り方優しいWAFの作り方
優しいWAFの作り方
techmemo
 

Was ist angesagt? (20)

Building a dashboard using AngularJS
Building a dashboard using AngularJSBuilding a dashboard using AngularJS
Building a dashboard using AngularJS
 
Micropage in microtime using microframework
Micropage in microtime using microframeworkMicropage in microtime using microframework
Micropage in microtime using microframework
 
Image Manipulation in WordPress 3.5 - WordCamp Phoenix 2013
Image Manipulation in WordPress 3.5 - WordCamp Phoenix 2013Image Manipulation in WordPress 3.5 - WordCamp Phoenix 2013
Image Manipulation in WordPress 3.5 - WordCamp Phoenix 2013
 
6. Add numbers in Laravel
6. Add numbers in Laravel6. Add numbers in Laravel
6. Add numbers in Laravel
 
Capybara
CapybaraCapybara
Capybara
 
Web+GISという視点から見たGISの方向性
Web+GISという視点から見たGISの方向性Web+GISという視点から見たGISの方向性
Web+GISという視点から見たGISの方向性
 
Mojolicious on Steroids
Mojolicious on SteroidsMojolicious on Steroids
Mojolicious on Steroids
 
Angular Promises and Advanced Routing
Angular Promises and Advanced RoutingAngular Promises and Advanced Routing
Angular Promises and Advanced Routing
 
21.search in laravel
21.search in laravel21.search in laravel
21.search in laravel
 
Mojolicious: what works and what doesn't
Mojolicious: what works and what doesn'tMojolicious: what works and what doesn't
Mojolicious: what works and what doesn't
 
Mojolicious - Perl Framework for the Real-Time Web (Lightning Talk)
Mojolicious - Perl Framework for the Real-Time Web (Lightning Talk)Mojolicious - Perl Framework for the Real-Time Web (Lightning Talk)
Mojolicious - Perl Framework for the Real-Time Web (Lightning Talk)
 
Code igniter parameter passing techniques
Code igniter parameter passing techniquesCode igniter parameter passing techniques
Code igniter parameter passing techniques
 
Dive into AngularJS Routing
Dive into AngularJS RoutingDive into AngularJS Routing
Dive into AngularJS Routing
 
Report: Avalanche 'very likely' to host outdoor game at Coors Field
Report: Avalanche 'very likely' to host outdoor game at Coors FieldReport: Avalanche 'very likely' to host outdoor game at Coors Field
Report: Avalanche 'very likely' to host outdoor game at Coors Field
 
Dion Almaer & Ben Galbraith - Build Once, Deploy Everywhere
Dion Almaer & Ben Galbraith - Build Once, Deploy EverywhereDion Almaer & Ben Galbraith - Build Once, Deploy Everywhere
Dion Almaer & Ben Galbraith - Build Once, Deploy Everywhere
 
How to develop modern web application framework
How to develop modern web application frameworkHow to develop modern web application framework
How to develop modern web application framework
 
優しいWAFの作り方
優しいWAFの作り方優しいWAFの作り方
優しいWAFの作り方
 
Developing apps using Perl
Developing apps using PerlDeveloping apps using Perl
Developing apps using Perl
 
With a Mighty Hammer
With a Mighty HammerWith a Mighty Hammer
With a Mighty Hammer
 
Mojolicious - A new hope
Mojolicious - A new hopeMojolicious - A new hope
Mojolicious - A new hope
 

Andere mochten auch

Desymfony 2011 - Tutorial #6 Assetic y Test Unitarios
Desymfony 2011 - Tutorial #6 Assetic y Test UnitariosDesymfony 2011 - Tutorial #6 Assetic y Test Unitarios
Desymfony 2011 - Tutorial #6 Assetic y Test Unitarios
Albert Jessurum
 
deSymfony 2012 - El entorno de Symfony2
deSymfony 2012 - El entorno de Symfony2deSymfony 2012 - El entorno de Symfony2
deSymfony 2012 - El entorno de Symfony2
Albert Jessurum
 

Andere mochten auch (7)

Desymfony 2011 - Tutorial #6 Assetic y Test Unitarios
Desymfony 2011 - Tutorial #6 Assetic y Test UnitariosDesymfony 2011 - Tutorial #6 Assetic y Test Unitarios
Desymfony 2011 - Tutorial #6 Assetic y Test Unitarios
 
deSymfony 2012 - El entorno de Symfony2
deSymfony 2012 - El entorno de Symfony2deSymfony 2012 - El entorno de Symfony2
deSymfony 2012 - El entorno de Symfony2
 
Designing Teams for Emerging Challenges
Designing Teams for Emerging ChallengesDesigning Teams for Emerging Challenges
Designing Teams for Emerging Challenges
 
UX, ethnography and possibilities: for Libraries, Museums and Archives
UX, ethnography and possibilities: for Libraries, Museums and ArchivesUX, ethnography and possibilities: for Libraries, Museums and Archives
UX, ethnography and possibilities: for Libraries, Museums and Archives
 
Visual Design with Data
Visual Design with DataVisual Design with Data
Visual Design with Data
 
3 Things Every Sales Team Needs to Be Thinking About in 2017
3 Things Every Sales Team Needs to Be Thinking About in 20173 Things Every Sales Team Needs to Be Thinking About in 2017
3 Things Every Sales Team Needs to Be Thinking About in 2017
 
How to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your NicheHow to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your Niche
 

Ähnlich wie Desymfony 2011 - Habemus Bundles

Curscatalyst
CurscatalystCurscatalyst
Curscatalyst
Kar Juan
 
Perl web frameworks
Perl web frameworksPerl web frameworks
Perl web frameworks
diego_k
 

Ähnlich wie Desymfony 2011 - Habemus Bundles (20)

Symfony2 for Midgard Developers
Symfony2 for Midgard DevelopersSymfony2 for Midgard Developers
Symfony2 for Midgard Developers
 
Redmine Betabeers SVQ
Redmine Betabeers SVQRedmine Betabeers SVQ
Redmine Betabeers SVQ
 
Quality Use Of Plugin
Quality Use Of PluginQuality Use Of Plugin
Quality Use Of Plugin
 
Curscatalyst
CurscatalystCurscatalyst
Curscatalyst
 
Perl web frameworks
Perl web frameworksPerl web frameworks
Perl web frameworks
 
Magento Live Australia 2016: Request Flow
Magento Live Australia 2016: Request FlowMagento Live Australia 2016: Request Flow
Magento Live Australia 2016: Request Flow
 
Curso Symfony - Clase 3
Curso Symfony - Clase 3Curso Symfony - Clase 3
Curso Symfony - Clase 3
 
How Kris Writes Symfony Apps
How Kris Writes Symfony AppsHow Kris Writes Symfony Apps
How Kris Writes Symfony Apps
 
Service approach for development REST API in Symfony2
Service approach for development REST API in Symfony2Service approach for development REST API in Symfony2
Service approach for development REST API in Symfony2
 
feature flagging with rails engines v0.2
feature flagging with rails engines v0.2 feature flagging with rails engines v0.2
feature flagging with rails engines v0.2
 
How kris-writes-symfony-apps-london
How kris-writes-symfony-apps-londonHow kris-writes-symfony-apps-london
How kris-writes-symfony-apps-london
 
QConSP 2015 - Dicas de Performance para Aplicações Web
QConSP 2015 - Dicas de Performance para Aplicações WebQConSP 2015 - Dicas de Performance para Aplicações Web
QConSP 2015 - Dicas de Performance para Aplicações Web
 
The Google App Engine Oil Framework
The Google App Engine Oil FrameworkThe Google App Engine Oil Framework
The Google App Engine Oil Framework
 
Using and reusing CakePHP plugins
Using and reusing CakePHP pluginsUsing and reusing CakePHP plugins
Using and reusing CakePHP plugins
 
TYPO3 Flow 2.0 (T3CON13 San Francisco)
TYPO3 Flow 2.0 (T3CON13 San Francisco)TYPO3 Flow 2.0 (T3CON13 San Francisco)
TYPO3 Flow 2.0 (T3CON13 San Francisco)
 
Capifony. Minsk PHP MeetUp #11
Capifony. Minsk PHP MeetUp #11Capifony. Minsk PHP MeetUp #11
Capifony. Minsk PHP MeetUp #11
 
Doctrine For Beginners
Doctrine For BeginnersDoctrine For Beginners
Doctrine For Beginners
 
Symfony2 - from the trenches
Symfony2 - from the trenchesSymfony2 - from the trenches
Symfony2 - from the trenches
 
Api Design
Api DesignApi Design
Api Design
 
Symfony tips and tricks
Symfony tips and tricksSymfony tips and tricks
Symfony tips and tricks
 

Kürzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Kürzlich hochgeladen (20)

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 

Desymfony 2011 - Habemus Bundles

  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 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
  • 19.
  • 20. // app/autoload.php use SymfonyComponentClassLoaderUniversalClassLoader; $loader = new UniversalClassLoader(); $loader->registerNamespaces(array( ‘Acme' => __DIR__.'/../vendor/bundles', ));
  • 21. // app/AppKernel.php public function registerBundles() { $bundles = array( new AcmeDemoBundleAcmeDemoBundle(), );
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30. /** * @Route("/blog") * @Cache(expires="tomorrow") */ class AnnotController extends Controller { /** * @Route("/") * @Template */ public function indexAction() { $posts = ...; return array('posts' => $posts); }
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37. class MyService { /** * @Secure(roles="ROLE_USER, ROLE_FOO, ROLE_ADMIN") */ public function secureMethod() { // ... }
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 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
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.
  • 52.
  • 53.
  • 54. # app/config/routing.yml users: type: rest resource: AcmeHelloBundleControllerUsersController
  • 55.
  • 56.
  • 57.
  • 58.
  • 59.
  • 60. # app/config/config.yml avalanche_imagine: filters: my_thumb: type: thumbnail options: { size: [100, 100], mode: outbound }
  • 61. {# 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') ?>" />
  • 62.
  • 63.
  • 64.
  • 65. 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 ); }
  • 66. public function testBasicAuthentication() { $this-> loadFixtures(array('LiipFooBundleTestsFixturesLoadUserData')); $content = $this->fetchContent('/users/foo', 'GET', true); $this->assertEquals('Hello foo!', $content); }
  • 67.
  • 68. 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