gdy dyrektywa imports to w php wywoływana jest metoda $this->import()
gdy dyrektywa twig, framework to w php wywołana jest metoda $container->loadFromExtension
Jak to wyjaśnić?
Ten poniższy paskudny kod lepiej oglądać z powyższego linka.
Kod
# app/config/config.yml
imports:
- { resource: parameters.yml }
- { resource: security.yml }
framework:
secret: '%secret%'
router: { resource: '%kernel.root_dir%/config/routing.yml' }
# ...
# Twig Configuration
twig:
debug: '%kernel.debug%'
strict_variables: '%kernel.debug%'
# ...
imports:
- { resource: parameters.yml }
- { resource: security.yml }
framework:
secret: '%secret%'
router: { resource: '%kernel.root_dir%/config/routing.yml' }
# ...
# Twig Configuration
twig:
debug: '%kernel.debug%'
strict_variables: '%kernel.debug%'
# ...
// app/config/config.php $this->import('parameters.yml'); $this->import('security.yml'); 'secret' => '%secret%', 'resource' => '%kernel.root_dir%/config/routing.php', ), // ... )); // Twig Configuration 'debug' => '%kernel.debug%', 'strict_variables' => '%kernel.debug%', )); // ...