update catalog to categorizer docs.

This commit is contained in:
Paweł Jędrzejewski 2012-03-28 22:33:20 +02:00
parent 6be273e8b2
commit 67a458aba4
2 changed files with 69 additions and 44 deletions

View file

@ -1,9 +1,9 @@
SyliusCatalogBundle
===================
SyliusCategorizerBundle
=======================
Categorizing whatever you want just got easier.
You can use this bundle to create multiple categorized catalogs of any object.
Categorizing whatever you want just got easier. You can use this bundle to create multiple categorized catalogs of any object.
It provides all controllers, routing, base mapping and services that boost you development.
No need to reimplement this feature every time you need it. Few lines of configuration, one almost empty class and we're ready to go!
Installation
------------
@ -11,14 +11,39 @@ Installation
Installing dependencies
~~~~~~~~~~~~~~~~~~~~~~~
Recommended way of managing dependencies for Sylius bundles is using `Composer <http://getcomposer.org>`_.
This bundle uses **Pagerfanta library** and **PagerfantaBundle**.
The installation guide can be found `here <https://github.com/whiteoctober/WhiteOctoberPagerfantaBundle>`_.
Downloading the bundle
~~~~~~~~~~~~~~~~~~~~~~
Installation via Composer
~~~~~~~~~~~~~~~~~~~~~~~~~
The good practice is to download it to `vendor/bundles/Sylius/Bundle/CatalogBundle`.
Create a `composer.json` file in your project root and add this.
.. code-block:: json
{
"require": {
"sylius/categorizer-bundle": "dev-master"
}
}
Then, download composer and install deps.
.. code-block:: bash
$ wget http://getcomposer.org/composer.phar
$ php composer.phar install
This should download all required libraries with the bundle itself.
You can use the Composer autoloader or define paths manually in your own `autoload.php`.
Downloading the bundle manually
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The good practice is to download it to `vendor/bundles/Sylius/Bundle/CategorizerBundle`.
This can be done in several ways, depending on your preference.
@ -29,9 +54,9 @@ Using the vendors script
Add the following lines in your `deps` file. ::
[SyliusCatalogBundle]
git=git://github.com/Sylius/SyliusCatalogBundle.git
target=bundles/Sylius/Bundle/CatalogBundle
[SyliusCategorizerBundle]
git=git://github.com/Sylius/SyliusCategorizerBundle.git
target=bundles/Sylius/Bundle/CategorizerBundle
Now, run the vendors script to download the bundle.
@ -46,7 +71,7 @@ If you prefer instead to use git submodules, then run the following lines.
.. code-block:: bash
$ git submodule add git://github.com/Sylius/SyliusCatalogBundle.git vendor/bundles/Sylius/Bundle/CatalogBundle
$ git submodule add git://github.com/Sylius/SyliusCategorizerBundle.git vendor/bundles/Sylius/Bundle/CategorizerBundle
$ git submodule update --init
Autoloader configuration
@ -79,7 +104,7 @@ Finally, enable the bundle in the kernel...
{
$bundles = array(
// ...
new Sylius\Bundle\CatalogBundle\SyliusCatalogBundle(),
new Sylius\Bundle\CategorizerBundle\SyliusCategorizerBundle(),
);
}
@ -92,11 +117,11 @@ Customize the prefixes or whatever you want.
.. code-block:: yaml
sylius_catalog_category:
resource: @SyliusCatalogBundle/Resources/config/routing/frontend/category.yml
sylius_categorizer_category:
resource: @SyliusCategorizerBundle/Resources/config/routing/frontend/category.yml
sylius_catalog_backend_category:
resource: @SyliusCatalogBundle/Resources/config/routing/backend/category.yml
sylius_categorizer_backend_category:
resource: @SyliusCategorizerBundle/Resources/config/routing/backend/category.yml
prefix: /administration
.. note::
@ -119,29 +144,15 @@ This is confiuguration used in sandbox app.
.. code-block:: yaml
sylius_catalog:
driver: ORM
sylius_categorizer:
driver: doctrine/orm
catalogs:
blog:
property: "posts"
classes:
model: Sylius\Sandbox\Bundle\BloggerBundle\Entity\Category
templates:
backend:
list: SandboxBloggerBundle:Backend/Category:list.html.twig
show: SandboxBloggerBundle:Backend/Category:show.html.twig
create: SandboxBloggerBundle:Backend/Category:create.html.twig
update: SandboxBloggerBundle:Backend/Category:update.html.twig
frontend:
list: SandboxBloggerBundle:Frontend/Category:list.html.twig
show: SandboxBloggerBundle:Frontend/Category:show.html.twig
assortment:
property: "products"
nested: true
sorter: sylius_assortment.sorter.product
classes:
model: Sylius\Sandbox\Bundle\AssortmentBundle\Entity\Category
form: Sylius\Sandbox\Bundle\AssortmentBundle\Form\Type\CategoryFormType
assortment: # Catalog alias.
property: "products" # Property used in your category model object to store items.
model: Sylius\Sandbox\Bundle\AssortmentBundle\Entity\Category # Your category class.
form: sylius_sandbox_assortment_category # Your category form type used when creating/updating category. Default form is just one text field, "name".
pagination:
mpp: 6 # Max per page.
templates:
backend:
list: SandboxAssortmentBundle:Backend/Category:list.html.twig
@ -151,15 +162,29 @@ This is confiuguration used in sandbox app.
frontend:
list: SandboxAssortmentBundle:Frontend/Category:list.html.twig
show: SandboxAssortmentBundle:Frontend/Category:show.html.twig
blog:
property: "posts"
model: Sylius\Sandbox\Bundle\BloggerBundle\Entity\Category
pagination:
disable: true # Disable pagination, just view all items. They will be retrived by using ->getPosts() category model method.
templates:
backend:
list: SandboxBloggerBundle:Backend/Category:list.html.twig
show: SandboxBloggerBundle:Backend/Category:show.html.twig
create: SandboxBloggerBundle:Backend/Category:create.html.twig
update: SandboxBloggerBundle:Backend/Category:update.html.twig
frontend:
list: SandboxBloggerBundle:Frontend/Category:list.html.twig
show: SandboxBloggerBundle:Frontend/Category:show.html.twig
Testing and continous integration
----------------------------------
.. image:: http://travis-ci.org/Sylius/SyliusCatalogBundle.png
.. image:: http://travis-ci.org/Sylius/SyliusCategorizerBundle.png
This bundle uses `travis-ci.org <http://travis-ci.org/Sylius/SyliusCatalogBundle>`_ for CI.
This bundle uses `travis-ci.org <http://travis-ci.org/Sylius/SyliusCategorizerBundle>`_ for CI.
Before running tests, load the dependencies using `Composer <http://packagist.org>`_.
Before running tests, load the dependencies using `Composer <http://getcomposer.org>`_.
.. code-block:: bash
@ -187,5 +212,5 @@ This bundle uses the awesome `Pagerfanta library <https://github.com/whiteoctobe
Bug tracking
------------
This bundle uses `GitHub issues <https://github.com/Sylius/SyliusCatalogBundle/issues>`_.
This bundle uses `GitHub issues <https://github.com/Sylius/SyliusCategorizerBundle/issues>`_.
If you have found bug, please create an issue.

View file

@ -18,7 +18,7 @@ Bundles reference
:maxdepth: 2
:numbered:
bundles/SyliusCatalogBundle
bundles/SyliusCategorizerBundle
bundles/SyliusAssortmentBundle
bundles/SyliusCartBundle
bundles/SyliusInstallerBundle