Giter Club home page Giter Club logo

sylius-nutrinfo-plugin's Introduction

INSTALLATION:

  1. Add Github repository to composer.json:

                {
                    "repositories": [
                        {
                            "type": "vcs",
                            "url":  "[email protected]:ecolos/sylius-nutrinfo-plugin.git"
                        }
                    ]
                }
    
  2. Install package via composer from Bitbucket

    composer require ecolos/sylius-nutrinfo-plugin
  3. Add to config/bundles.php

            [
                Ecolos\SyliusNutrinfoPlugin\EcolosSyliusNutrinfoPlugin::class => ['all' => true],
                Burgov\Bundle\KeyValueFormBundle\BurgovKeyValueFormBundle::class => ['all' => true],
            ]
  4. Clear the symfony cache

    php bin/console cache:clear
  5. Determine doctrine schema changes and migrate

    php bin/console doctrine:migrations:diff
    php bin/console doctrine:migrations:execute --up XXXXXXXXXXXXX
  6. Add to config/services.yaml

    imports:
      - { resource: "@EcolosSyliusNutrinfoPlugin/Resources/config/config.yml" }
  7. Add to config/routes.yaml

    ecolos_sylius_nutrinfo_plugin:
        resource: "@EcolosSyliusNutrinfoPlugin/Resources/config/routing.yml"
  8. Add to config/packages/_sylius.yaml

    imports:
        - { resource: "@EcolosSyliusNutrinfoPlugin/Resources/config/_sylius.yml" }
  9. Add traits to entities

    src/Entity/ProductVariant.php

    <?php
    use Ecolos\SyliusNutrinfoPlugin\Entity\NutrinfoVariantTrait;
    class ProductVariant { use NutrinfoVariantTrait; }

    src/Entity/Product.php

    <?php
    use Ecolos\SyliusNutrinfoPlugin\Entity\NutrinfoProductTrait;
    class Product { use NutrinfoProductTrait; }
  10. Add admin form components

    templates/bundles/SyliusAdminBundle/ProductVariant/Tab/_details.html.twig

    {% form_theme form.nutrinfo '@EcolosSyliusNutrinfoPlugin/Admin/nutrinfo.html.twig' %}
    {{ form_row(form.nutrinfo) }}

    templates/bundles/SyliusAdminBundle/Product/Tab/_details.html.twig

    {% form_theme form.nutrinfo '@EcolosSyliusNutrinfoPlugin/Admin/nutrinfo.html.twig' %}
    {{ form_row(form.nutrinfo) }}

USAGE:

Check out the product(-variant) form in the admin section. A form component will be rendered.

TODO:

  • Add tests

sylius-nutrinfo-plugin's People

Contributors

matthiez avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.