A simple Silex skeleton project with Twig, Doctrine, ORM, Bootstrap, jQuery and other common components.
To view the full list of dependancies, have a look at the composer.json file.
Based on Fabien Potencier's Silex Skeleton, but with more up to date dependencies and a different structure.
$ curl -sS https://getcomposer.org/installer | php
$ php composer.phar create-project madebydavid/silex-skeleton-orm silex-project
$ cd silex-project
3. Configure the database in the dev config file:
$app['config'] = array(
'db.options' => array(
'driver' => 'pdo_mysql',
'dbname' => 'skeleton-dev',
'user' => 'root',
'password' => ''
)
);
$ mysqladmin -uroot create skeleton-dev
You can create your model with Doctrine YAML documents in the config/doctrine/schema directory, make a new file called Model.EntityName.dcm.yml for each entity:
#config/doctrine/schema/Model.Person.dcm.yml
Model\Person:
type: entity
table: person
fields:
id:
type: integer
id: true
generator:
strategy: AUTO
name:
type: string
length: 255
created:
type: datetime
columnDefinition: TIMESTAMP DEFAULT CURRENT_TIMESTAMP
$ ./console orm:generate-entities src/
$ ./console orm:schema-tool:create