Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove AppBundle from docs. #9995

Merged
merged 1 commit into from
Dec 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/book/architecture/translations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Assuming that we would like to have a translatable model of a ``Supplier``, we n

<?php

namespace AppBundle\Entity;
namespace App\Entity;

use Sylius\Component\Resource\Model\AbstractTranslation;

Expand Down Expand Up @@ -60,7 +60,7 @@ The actual entity has access to its translation by using the ``TranslatableTrait

<?php

namespace AppBundle\Entity;
namespace App\Entity;

use Sylius\Component\Resource\Model\TranslatableInterface;
use Sylius\Component\Resource\Model\TranslatableTrait;
Expand Down
2 changes: 1 addition & 1 deletion docs/book/installation/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ In the root directory of your project you will find these important subdirectori
* ``config/`` - here you will be adding the yaml configuration files including routing, security, state machines configurations etc.
* ``var/log/`` - these are the logs of your application
* ``var/cache/`` - this is the cache of you project
* ``src/`` - this is where you will be adding all you custom logic in the ``AppBundle``
* ``src/`` - this is where you will be adding all you custom logic in the ``App``
* ``public/`` - there you will be placing assets of your project

.. tip::
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ to skip the configuration part for now:

.. code-block:: php

namespace AppBundle\Fixture;
namespace App\Fixture;

use Sylius\Bundle\FixturesBundle\Fixture\AbstractFixture;
use Sylius\Bundle\FixturesBundle\Fixture\FixtureInterface;
Expand Down Expand Up @@ -46,7 +46,7 @@ The next step is to register this fixture:

.. code-block:: xml

<service id="app.fixture.country" class="AppBundle\Fixture\CountryFixture">
<service id="app.fixture.country" class="App\Fixture\CountryFixture">
<argument type="service" id="doctrine.orm.entity_manager" />
<tag name="sylius_fixtures.fixture" />
</service>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Let's create a listener that removes the directory before loading the fixtures.

.. code-block:: php

namespace AppBundle\Listener;
namespace App\Listener;

use Sylius\Bundle\FixturesBundle\Listener\AbstractListener;
use Sylius\Bundle\FixturesBundle\Listener\BeforeSuiteListenerInterface;
Expand All @@ -32,7 +32,7 @@ The next step is to register this listener:

.. code-block:: xml

<service id="app.listener.directory_purger" class="AppBundle\Listener\DirectoryPurgerListener">
<service id="app.listener.directory_purger" class="App\Listener\DirectoryPurgerListener">
<tag name="sylius_fixtures.listener" />
</service>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Let's assume that you already have a route for contacting your suppliers, then y
driver:
name: doctrine/orm
options:
class: AppBundle\Entity\Supplier
class: App\Entity\Supplier
actions:
item:
contactSupplier:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ All you need to do is create your own class implementing FieldTypeInterface and

<?php

namespace AppBundle\Grid\FieldType;
namespace App\Grid\FieldType;

use Sylius\Component\Grid\Definition\Field;
use Sylius\Component\Grid\FieldTypes\FieldTypeInterface;
Expand Down Expand Up @@ -46,7 +46,7 @@ That is all. Now register your new field type as a service.

# config/services.yaml
app.grid_field.custom:
class: AppBundle\Grid\FieldType\CustomType
class: App\Grid\FieldType\CustomType
tags:
- { name: sylius.grid_field, type: custom }

Expand All @@ -60,7 +60,7 @@ Now you can use your new column type in the grid configuration!
driver:
name: doctrine/orm
options:
class: AppBundle\Entity\Supplier
class: App\Entity\Supplier
fields:
name:
type: custom
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ To add a new filter, we need to create an appropriate class and form type.

<?php

namespace AppBundle\Grid\Filter;
namespace App\Grid\Filter;

use Sylius\Component\Grid\Data\DataSourceInterface;
use Sylius\Component\Grid\Filtering\FilterInterface;
Expand All @@ -31,7 +31,7 @@ And the form type:

<?php

namespace AppBundle\Form\Type\Filter;
namespace App\Form\Type\Filter;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
Expand Down Expand Up @@ -77,12 +77,12 @@ That is all. Now let's register your new filter type as service.

services:
app.grid.filter.suppliers_statistics:
class: AppBundle\Grid\Filter\SuppliersStatisticsFilter
class: App\Grid\Filter\SuppliersStatisticsFilter
tags:
-
name: sylius.grid_filter
type: suppliers_statistics
form_type: AppBundle\Form\Type\Filter\SuppliersStatisticsFilterType
form_type: App\Form\Type\Filter\SuppliersStatisticsFilterType

Now you can use your new filter type in the grid configuration!

Expand All @@ -100,4 +100,4 @@ Now you can use your new filter type in the grid configuration!
range: [0, 100]
templates:
filter:
suppliers_statistics: 'AppBundle:Grid/Filter:suppliers_statistics.html.twig'
suppliers_statistics: 'App:Grid/Filter:suppliers_statistics.html.twig'
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ If you don’t have it yet create a file ``app/config/resources.yml``, import it
app.supplier:
driver: doctrine/orm
classes:
model: AppBundle\Entity\Supplier
model: App\Entity\Supplier

.. code-block:: yaml

Expand Down Expand Up @@ -45,7 +45,7 @@ Now we can configure our first grid:
driver:
name: doctrine/orm
options:
class: AppBundle\Entity\Supplier
class: App\Entity\Supplier
fields:
name:
type: string
Expand Down Expand Up @@ -185,7 +185,7 @@ This first requires a :doc:`custom repository method </customization/repository>
driver:
name: doctrine/orm
options:
class: AppBundle\Entity\Supplier
class: App\Entity\Supplier
repository:
method: mySupplierGridQuery

Expand Down Expand Up @@ -258,7 +258,7 @@ If your field is not of a "simple" type, f.i. a twig template with a specific pa
origin:
type: twig
options:
template: "@AppBundle/Grid/Fields/myCountryFlags.html.twig"
template: "@App/Grid/Fields/myCountryFlags.html.twig"
path: address.country
label: app.ui.country
sortable: address.country
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,16 @@ Let's assume we want to implement a book store application and track the books i

You have to create a `Book` and an `InventoryUnit` entity, living inside your application code.
We think that **keeping the app-specific bundle structure simple** is a good practice, so
let's assume you have your ``AppBundle`` registered under ``App\Bundle\AppBundle`` namespace.
let's assume you have your ``App`` registered under ``App\Bundle\AppBundle`` namespace.

We will create `Book` entity.

.. code-block:: php

<?php

// src/App/AppBundle/Entity/Book.php
namespace App\AppBundle\Entity;
// src/Entity/Book.php
namespace App\Entity;

use Sylius\Component\Inventory\Model\StockableInterface;
use Doctrine\ORM\Mapping as ORM;
Expand Down Expand Up @@ -160,8 +160,8 @@ The next step requires the creating of the `InventoryUnit` entity, let’s do th

<?php

// src/App/AppBundle/Entity/InventoryUnit.php
namespace App\AppBundle\Entity;
// src/Entity/InventoryUnit.php
namespace App\Entity;

use Sylius\Component\Inventory\Model\InventoryUnit as BaseInventoryUnit;
use Doctrine\ORM\Mapping as ORM;
Expand Down Expand Up @@ -196,7 +196,7 @@ Put this configuration inside your ``app/config/config.yml``.
resources:
inventory_unit:
classes:
model: App\AppBundle\Entity\InventoryUnit
model: App\Entity\InventoryUnit


Updating database schema
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ Configuration reference
emails:
your_email:
subject: Subject of your email
template: AppBundle:Email:yourEmail.html.twig
template: App:Email:yourEmail.html.twig
enabled: true/false
sender:
name: Custom name
address: Custom sender address for this e-mail
your_another_email:
subject: Subject of your another email
template: AppBundle:Email:yourAnotherEmail.html.twig
template: App:Email:yourAnotherEmail.html.twig
enabled: true/false
sender:
name: Custom name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ In your ``app/config/config.yml``, under ``sylius_mailer`` you should configure
emails:
movie_added_notification:
subject: A new movie {{ movie.title }} has been submitted
template: AppBundle:Email:movieAddedNotification.html.twig
template: App:Email:movieAddedNotification.html.twig

That's it! Your unique code is "movie_added_notification". Now, let's create the template.

Expand Down Expand Up @@ -58,7 +58,7 @@ The service responsible for sending an e-mail has id ``sylius.email_sender``. Al

<?php

namespace App\AppBundle\Controller;
namespace App\Controller;

use Symfony\Component\HttpFoundation\Request;

Expand All @@ -78,7 +78,7 @@ Listener example:

<?php

namespace App\AppBundle\Controller;
namespace App\Controller;

use App\Event\MovieCreatedEvent;
use Sylius\Component\Mailer\Sender\SenderInterface;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Put its configuration inside your ``app/config/config.yml``.
resources:
promotion_subject:
classes:
model: AppBundle\Entity\CarRentalOrder
model: App\Entity\CarRentalOrder

And configure doctrine extensions which are used by the bundle.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Implement the ResourceInterface in your model class.

<?php

namespace AppBundle\Entity;
namespace App\Entity;

use Sylius\Component\Resource\Model\ResourceInterface;

Expand All @@ -46,7 +46,7 @@ In your ``app/config/config.yml`` add:
resources:
app.book:
classes:
model: AppBundle\Entity\Book
model: App\Entity\Book

That's it! Your Book entity is now registered as Sylius Resource.

Expand All @@ -66,11 +66,11 @@ You can also configure several doctrine drivers.
resources:
app.book:
classes:
model: AppBundle\Entity\Book
model: App\Entity\Book
app.article:
driver: doctrine/phpcr-odm
classes:
model: AppBundle\Document\ArticleDocument
model: App\Document\ArticleDocument

Generate API routing.
---------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ __ http://symfony.com/doc/current/forms.html#building-the-form
defaults:
_controller: app.controller.book:createAction
_sylius:
form: AppBundle\Form\BookType
form: App\Form\BookType

Passing Custom Options to Form
------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Create a FormType class for your resource

<?php

namespace AppBundle\Form\Type;
namespace App\Form\Type;

use Sylius\Bundle\ResourceBundle\Form\Type\AbstractResourceType;
use Symfony\Component\Form\FormBuilderInterface;
Expand Down Expand Up @@ -53,7 +53,7 @@ Register the FormType as a service
.. code-block:: yaml

app.book.form.type:
class: AppBundle\Form\Type\BookType
class: App\Form\Type\BookType
tags:
- { name: form.type }
arguments: ['%app.model.book.class%', '%app.book.form.type.validation_groups%']
Expand All @@ -67,7 +67,7 @@ Configure the form for your resource
resources:
app.book:
classes:
model: AppBundle\Entity\Book
form: AppBundle\Form\Type\BookType
model: App\Entity\Book
form: App\Form\Type\BookType

That's it. Your new class will be used for all forms!
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Routing Generator Configuration Reference
code: $code
section: admin
templates: :Book
form: AppBundle/Form/Type/SimpleBookType
form: App/Form/Type/SimpleBookType
redirect: create
except: ['show']
only: ['create', 'index']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,10 @@ If you want to use a custom form:
app_book:
resource: |
alias: app.book
form: AppBundle/Form/Type/AdminBookType
form: App/Form/Type/AdminBookType
type: sylius.resource

``create`` and ``update`` actions will use AppBundle/Form/Type/AdminBookType form type.
``create`` and ``update`` actions will use App/Form/Type/AdminBookType form type.

.. note::

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Same way like for **createAction** you can override the default form.
defaults:
_controller: app.controller.book:updateAction
_sylius:
form: AppBundle\Form\BookType
form: App\Form\BookType

Passing Custom Options to Form
------------------------------
Expand Down
Loading