Skip to content
Symfony 4 bundle
PHP HTML
Branch: master
Clone or download
Latest commit 530d865 Aug 13, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src ^ Aug 13, 2019
tests ^ Jul 26, 2019
.gitignore + .gitignore Aug 9, 2019
README.md ^ Aug 11, 2019
composer.json ^ composer Aug 9, 2019

README.md

Install

Edit config/services.yaml and add:

parameters:
    root: '%kernel.root_dir%/..'
    tmp: '%root%/var/tmp'
    static: '%root%/public/static/..'
    borealis:
        bundle:     'App'
        root:       '%root%'
        tmp:        '%tmp%'
        resources:  '%kernel.root_dir%/../var/resources'
        locales:    ['en', 'ro']
        locale:     'en'

Composer

  • PRD: composer require sindla/borealis

  • DEV: composer require sindla/borealis:dev-master

  • Edit composer.json and add

    "post-update-cmd": [
    ...
    "Sindla\\Bundle\\BorealisBundle\\Composer\\ScriptHandler::postUpdate" 
    ]
  • Edit config/packages/twig.yaml and add
twig:
    default_path: '%kernel.project_dir%/templates'
    debug: '%kernel.debug%'
    strict_variables: '%kernel.debug%'
    paths:
        '%kernel.project_dir%/vendor/sindla/borealis/src/templates': Borealis
    globals:
        borealis: '@borealis.twig.utility'

How to pass a borealis service to a controller?
# src/Controller/StaticController.php

use Sindla\Bundle\BorealisBundle\Utils\Client\Client as BorelisClient;

class ... {
    private $BorelisClient;
    
    public function __construct(BorelisClient $BorelisClient)
    {
        /** @var BorelisClient */
        $this->BorelisClient = $BorelisClient;
    }
    
    {
        $this->BorelisClient->ip2CountryCode($this->BorelisClient->ip($Request));
    }
}
# config/services.yaml
 
services:
    ...
    App\Controller\StaticController:
        arguments:
            $BorelisClient: '@borealis.client'

  • Edit app/config/routing.yml and add
aurora:
    resource: '@BorealisBundle/Controller/'
    type: annotation
You can’t perform that action at this time.