From 3a35c327c5d1c33b9f525d71dac60d25fe87f2d0 Mon Sep 17 00:00:00 2001 From: Francois Zaninotto Date: Mon, 7 Jun 2010 00:10:59 +0200 Subject: [PATCH] [PropelBundle] Added more details in the README --- src/Symfony/Framework/PropelBundle/README | 51 ++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Framework/PropelBundle/README b/src/Symfony/Framework/PropelBundle/README index e82eb83f89..c312bb6417 100644 --- a/src/Symfony/Framework/PropelBundle/README +++ b/src/Symfony/Framework/PropelBundle/README @@ -6,7 +6,8 @@ This is a (work in progress) implementation of Propel in Symfony 2. Currently supports: * Generation of model classes based on an XML schema (not YAML) placed under `BundleName/Resources/*schema.xml`. - * Propel runtime initialization through `$container->getPropelService()`. + * Runtime autoloading of Propel and generated classes + * Propel runtime initialization through the XML configuration. Installation ------------ @@ -42,6 +43,54 @@ Sample Configuration # dsn: mysql:host=localhost;dbname=test # options: {} +### Sample Schema + +Place the following schema in src/Application/HelloBundle/Resources/config/schema.xml: + + + + + + + + + + + + +
+ + + + + +
+ +
+ +### Build Process + +Call the application console with the `propel:build` task: + + > ./hello/console propel:build --classes + +### Use The Model Classes + +Use the Model classes as any other class in Symfony. Just use the correct namespace, and Symfony will autoload them: + + class HelloController extends Controller + { + public function indexAction($name) + { + $author = new \Application\HelloBundle\Model\Author(); + $author->setFirstName($name); + $author->save(); + + return $this->render('HelloBundle:Hello:index', array('name' => $name, 'author' => $author)); + } + } + + Known Problems --------------