This is a Test bundle to test the power of the symfony framework.
This bundle provides:
- A Form to persist in the database a nickname.
- A Random Lottery raffle that show the winner.
There is an example of the project on-line in: http://lottery.feerb.com/
This version of the bundle requires Symfony 2.8.
If you are starting a new project you need install symfony standard, if you already have a symfony project go to next step.
If you arent install symfony yet you need to read symfony install documentation
Add this bundle into src/ folder
Enable the SimpleLotteryBundle bundle in your AppKernel
<?php
// app/AppKernel.php
public function registerBundles()
{
$bundles = array(
// ...
new SimpleLotteryBundle\SimpleLotteryBundle(),
);
}
Fist, if you aren't configured your database you need to read symfony database documentation.
Your parameters should looks like this.
# app/config/parameters.yml
parameters:
database_driver: pdo_mysql
database_host: 127.0.0.1
database_port: null
database_name: blog_bundle_dev
database_user: myUser
database_password: myPass
locale: en
secret: ThisTokenIsNotSoSecretChangeIt
Now that the bundle is configured, the last thing you need to do is update your database schema.
run following command.
$ php doctrine:schema:update --dump-sql
It will show the changes that will be made ββin the database, if everything is correct then you can execute.
$ php doctrine:schema:update --force