Merge branch 'master' of github.com:Sylius/Documentation

This commit is contained in:
Paweł Jędrzejewski 2012-03-28 22:33:29 +02:00
commit 77240fa5de

View file

@ -22,20 +22,21 @@ This can be done in several ways, depending on your preference.
The first method is the standard Symfony2 method. The first method is the standard Symfony2 method.
Using the vendors script Using the Composer
************************ ************************
Add the following lines in your `deps` file. :: Add the following lines in your `composer.json` file. ::
[SyliusBloggerBundle] "require": {
git=git://github.com/Sylius/SyliusBloggerBundle.git ...
target=bundles/Sylius/Bundle/BloggerBundle "sylius/blogger-bundle": "dev-master"
}
Now, run the vendors script to download the bundle. Now, run the vendors script to download the bundle.
.. code-block:: bash .. code-block:: bash
$ php bin/vendors install $ php composer.phar update
Using submodules Using submodules
**************** ****************
@ -84,9 +85,22 @@ Finally, enable the bundle in the kernel...
Importing routing configuration Importing routing configuration
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. note:: .. code-block:: yaml
This part is not written yet. sylius_blogger_post:
resource: @SyliusBloggerBundle/Resources/config/routing/frontend/post.yml
prefix: /posts
sylius_blogger_backend_post:
resource: @SyliusBloggerBundle/Resources/config/routing/backend/post.yml
prefix: /administration/posts
Or in XML format:
.. code-block:: xml
<import resource="@SyliusBloggerBundle/Resources/config/routing/frontend/post.yml" prefix="/posts" />
<import resource="@SyliusBloggerBundle/Resources/config/routing/backend/post.yml" prefix="/administration/posts" />
Container configuration Container configuration
~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~
@ -109,16 +123,60 @@ For "**ORM**" driver run the following command.
Usage guide Usage guide
----------- -----------
.. note:: Set your blogger bundle as a child of SyliusBloggerBundle. Add following lines to `ApplicationSyliusBloggerBundel.php`:
This part is not written yet. .. code-block:: php
public function getParent()
{
return 'SyliusBloggerBundle';
}
Create Post class:
.. code-block:: php
<?php
namespace Application\Sylius\BloggerBundle\Entity\Post;
use Sylius\Bundle\BloggerBundle\Entity\Post as BasePost;
class Post extends BasePost
{
}
Create PostType class:
.. code-block:: php
<?php
namespace Application\Sylius\BloggerBundle\Form\Type;
use Sylius\Bundle\BloggerBundle\Form\Type\PostType as BasePostType;
use Symfony\Component\Form\FormBuilder;
class PostType extends BasePostType
{
public function buildForm(FormBuilder $builder, array $options)
{
parent::buildForm($builder, $options);
// ...
}
}
Configuration reference Configuration reference
----------------------- -----------------------
.. note:: .. code-block:: yaml
This part is not written yet. sylius_blogger:
driver: doctrine/orm
engine: twig # or php
classes:
model:
post: Application\Sylius\BloggerBundle\Entity\Post
form:
type:
post: Application\Sylius\BloggerBundle\Form\Type\PostType
Testing and continous integration Testing and continous integration
---------------------------------- ----------------------------------