madebydavid / silex-skeleton-orm
There is no license information available for the latest version (v2.0) of this package.
Skeleton Silex app with ORM and cli tool for generating model and schema
v2.0
2014-09-02 16:52 UTC
Requires
- dflydev/doctrine-orm-service-provider: 2.0.*
- doctrine/dbal: 2.5.*
- jquery/jquery: 1.11.1
- monolog/monolog: 1.11.*
- saxulum/saxulum-doctrine-orm-manager-registry-provider: 3.0.0
- silex/silex: 2.0.*@dev
- symfony/class-loader: 2.6.*
- symfony/config: 2.6.*
- symfony/console: 2.6.*
- symfony/doctrine-bridge: 2.6.*
- symfony/form: 2.6.*
- symfony/locale: 2.6.*
- symfony/translation: 2.6.*
- symfony/twig-bridge: 2.6.*
- symfony/validator: 2.6.*
- symfony/yaml: 2.6.*
- twig/twig: 1.16.*
- twitter/bootstrap: 2.3.*
This package is not auto-updated.
Last update: 2024-11-09 16:00:53 UTC
README
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.
To install with composer
1. Install composer if you don't have it already:
$ curl -sS https://getcomposer.org/installer | php
2. Grab this project as your base
$ 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' => '' ) );
4. Create the database which you have just configured:
$ mysqladmin -uroot create skeleton-dev
5. Create your model
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
6. Generate the Entity classes from the YAML:
$ ./console orm:generate-entities src/
7. Create the schema:
$ ./console orm:schema-tool:create