Git Product home page Git Product logo

acmepizzabundle's Introduction

Acme Pizza Bundle

This is a test-bundle for the experimental form support.

It is very early status and will be finalized as a demo example over the weekend.

Distribution: Best used with Symfony Standard Edition

Requirements

Symfony(https://github.com/symfony/symfony) obviously.

Installation

Add the deps for the needed bundles

[AcmePizzaBundle]
    git=https://github.com/beberlei/AcmePizzaBundle.git
    target=/bundles/Acme/PizzaBundle

[doctrine-fixtures]
    git=http://github.com/doctrine/data-fixtures.git

[DoctrineFixturesBundle]
    git=http://github.com/symfony/DoctrineFixturesBundle.git
    target=/bundles/Symfony/Bundle/DoctrineFixturesBundle

Next, run the vendors script to download the bundles:

$ php bin/vendors install

Add to autoload.php

$loader->registerNamespaces(array(
    'Acme'             => __DIR__.'/../vendor/bundles',
    // ...

Register AcmePizzaBundle to Kernel

<?php

    # app/AppKernel.php
    //...
    $bundles = array(
        //...
        new Acme\PizzaBundle\AcmePizzaBundle(),
    );
    //...

Create database and schema

$ php app/console doctrine:database:create
$ php app/console doctrine:schema:create

Enable routing configuration

# app/config/routing.yml
AcmePizzaBundle:
    resource: "@AcmePizzaBundle/Controller/"
    type:     annotation
    prefix:   /acme-pizza

Refresh asset folder

$ php app/console assets:install web/

Data fixtures (optional)

First, make sure that your db parameters are correctly set in app/config/parameters.ini. You'll need to install Doctrine Data Fixtures (don't forget to add the path to AppKernel.php) and then run:

$ php app/console doctrine:fixtures:load

You can read about install instructions in the Symfony2 Cookbook(http://symfony.com/doc/2.0/cookbook/doctrine/doctrine_fixtures.html#setup-and-configuration)

Usage

Go to app_dev.php/acme-pizza/pizza/list and start selling pizzas.

Testing

You can launch functional tests with Selenium RC server running with the following steps:

  • download selenium server
  • edit app/phpunit.xml.dist:
    • add php's server variable to match your configuration
    • add the selenium's browser configuration. I added Google Chrome Portable because it's faster than ie or even firefox.

app/phpunit.xml.dist

# app/phpunit.xml.dist
<!-- ... -->
<php>
    <server
        name  = "KERNEL_DIR"
        value = "/var/www/AcmePizza/app/" />
    <server
        name  = "HTTP_HOST"
        value = "localhost" />
    <server
        name  = "SCRIPT_NAME"
        value = "/AcmePizza/web/app_dev.php" />
</php>
<!-- ... -->

<!-- ... -->
<selenium>
    <browser
        name    = "Google Chrome Portable"
        browser = "*custom c:\bin\GoogleChromePortable\GoogleChromePortable.exe -disable-popup-blocking -proxy-server=127.0.0.1:4444"
        host    = "127.0.0.1" /> <!-- ip of selenium RC server -->
</selenium>
<!-- ... -->

Now you can run test (assuming that Selenium RC is running java -jar selenium-server-standalone-2.2.0.jar) with phpunit -c app/ src/Acme/PizzaBundle/Tests/ If you want you can submit other missing tests.

acmepizzabundle's People

Contributors

beberlei avatar brikou avatar carlossg00 avatar cordoval avatar mdpatrick avatar schniper avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

acmepizzabundle's Issues

fatal error when diaplying form (theme renderer needs array)

There is a problem when displaying form...

Create a Pizza

Catchable fatal error: Argument 1 passed to Symfony\Component\Form\Renderer\ThemeRenderer::render() must be an array, string given, called in /mnt/hgfs/www/AcmePizza/vendor/symfony/src/Symfony/Component/Form/Renderer/ThemeRenderer.php on line 127 and defined in /mnt/hgfs/www/AcmePizza/vendor/symfony/src/Symfony/Component/Form/Renderer/ThemeRenderer.php on line 175

Example using Event Listeners in forms

Hi, i'm facing a situation that i need to use event listeners, i would like to know if is possible to implement it in this bundle to show how it works?

In my situation i need it to select cities based on the county and country selection first.

I have follow this article without success: http://webb-on-the-web.com/?p=5

I sent an email to ML but i didn't got any response yet, i would like to help in this feature and in others. I created a gist maybe could help explain the situation: https://gist.github.com/1127540

In AcmePizzaBundle, we can try to implement a detailed address for the client with the city and state using event listeners what do you think?

Thanks in advance,

Daniel Gomes

context validation doesn't work

when a known customer order pizzas (and give his phone number) validation failed because address fields are left blank, ... validation should be omitted because address is retrieved from database

Which symfony experimental/standard version works fine?

@beberlei : Hello can you give me the supported versions (commit number) of sf standard and sf experimental in order to improve the README.md (with supported git version), once this done I could add Functional test to each form ;) (In fact I'm waiting for bschussek to merge last stuff about short bundle name). If you don't have time just tell me, there is no problem :)

Collection protoytype broken in RC5

I'm still learning how to best implement collections w/ allow_add, allow_delete and protoytype so I can't provide a pull request.

Looks like the way the collection fieldtype works has changed. Here's the error:

Key "$$name$$" in object (with ArrayAccess) of type "Symfony\Component\Form\FormView" does not exist in "AcmePizzaBundle:Order:index.html.twig" at line 36

Cheers Leevi

2.1 compatibility issue?

I updated the deprecated methods in the controllers. I think I have everything installed properly, database wise. I used composer to build a vanilla version of 2.1 and composer to install the pizzabundle.

Getting the fatal error below

Fatal error: Declaration of Acme\PizzaBundle\Form\OrderFormType::buildForm() must be compatible with that of Symfony\Component\Form\FormTypeInterface::buildForm() in C:\Users\llindquist\Web\acmepizza\vendor\beberlei\acme-pizza\Acme\PizzaBundle\Form\OrderFormType.php on line 11

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.