Sunshine Admin Bundle
  • Sunshine Admin Bundle
  • Setup
  • Theme Configuration
  • YAML Entity configuration
  • YAML Entity List Sort
  • Menu Configuration
  • Field type and overrides
  • Entity Relations
  • Filtering : Default values
  • Filtering : Options multiple
  • Filtering : Custom values in Select2 lists
  • Roles & Permissions
  • Creating a page
  • Widgets
  • Generic Widgets : LIST
  • Tuto - 1/x - Create SF4 Project
Powered by GitBook
On this page
  • Enable Symfony serializer component
  • Import the bundle using composer
  • Add the bundle to the kernel
  • Update your project configuration

Setup

Setup & Configuration of the bundle in your project

Enable Symfony serializer component

Add the namespace to be able to extend Sunshine templates:

app/config/config.yml
# Twig Configuration
twig:
 [...]
    paths:
        '%kernel.root_dir%/../vendor/tellaw/sunshine-admin-bundle/Tellaw/SunshineAdminBundle/Resources/views': sunshine
 [...]

Import the bundle using composer

composer require tellaw/sunshine-admin-bundle

Please check Packagist to find the latest release : https://packagist.org/packages/tellaw/sunshine-admin-bundle

Add the bundle to the kernel

    public function registerBundles()
    {
        $bundles = [
            new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
            new Symfony\Bundle\SecurityBundle\SecurityBundle(),
            new Symfony\Bundle\TwigBundle\TwigBundle(),
            new Symfony\Bundle\MonologBundle\MonologBundle(),
            new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
            new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
            new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
            new AppBundle\AppBundle(),
            
            ...
            new Tellaw\SunshineAdminBundle\TellawSunshineAdminBundle(),
            ...
        ];

        if (in_array($this->getEnvironment(), ['dev', 'test'], true)) {
            $bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle();
            $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
            $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
            $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
            $bundles[] = new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle();
        }

        return $bundles;
    }

Add the following line :

new Tellaw\SunshineAdminBundle\TellawSunshineAdminBundle(),

Update your project configuration

Add to your routing.yml

tellaw_sunshine_admin:
    resource: "@TellawSunshineAdminBundle/Controller"
    type:     annotation
    prefix:   /admin

Note that you can configure the root path of your admin here. Just replace /admin by anything.

PreviousSunshine Admin BundleNextTheme Configuration

Last updated 7 years ago