- ///Config array
- protected $config;
-
- ///ContainerInterface instance
- protected $container;
-
- ///Context array
- protected $context;
-
- ///Router instance
- protected $router;
-
- ///Translator instance
- protected $translator;
-
- ///Request instance
- protected $request;
-
- ///Locale instance
- protected $locale;
-
- /**
- * Inject container, router and translator interface
- *
- * @param ContainerInterface $container The container instance
- * @param RouterInterface $router The router instance
- * @param TranslatorInterface $translator The translator instance
- */
- public function __construct(ContainerInterface $container, RouterInterface $router, TranslatorInterface $translator) {
- //Retrieve config
- $this->config = $container->getParameter(self::getAlias());
-
- //Set the container
- $this->container = $container;
-
- //Set the router
- $this->router = $router;
-
- //Set the translator
- $this->translator = $translator;
-
- //Set the context
- $this->context = [
- 'contact' => [
- 'title' => $translator->trans($this->config['contact']['title']),
- 'mail' => $this->config['contact']['mail']
- ],
- 'copy' => [
- 'by' => $translator->trans($this->config['copy']['by']),
- 'link' => $this->config['copy']['link'],
- 'long' => $translator->trans($this->config['copy']['long']),
- 'short' => $translator->trans($this->config['copy']['short']),
- 'title' => $this->config['copy']['title']
- ],
- 'page' => [
- 'description' => null,
- 'section' => null,
- 'title' => null
- ],
- 'site' => [
- 'donate' => $this->config['site']['donate'],
- 'ico' => $this->config['site']['ico'],
- 'logo' => $this->config['site']['logo'],
- 'png' => $this->config['site']['png'],
- 'svg' => $this->config['site']['svg'],
- 'title' => $translator->trans($this->config['site']['title']),
- 'url' => $router->generate($this->config['site']['url'])
- ],
- 'canonical' => null,
- 'alternates' => [],
- 'facebook' => [
- 'heads' => [
- 'og' => 'http://ogp.me/ns#',
- 'fb' => 'http://ogp.me/ns/fb#'
- ],
- 'metas' => [
- 'og:type' => 'article',
- 'og:site_name' => $this->translator->trans($this->config['site']['title']),
- #'fb:admins' => $this->config['facebook']['admins'],
- 'fb:app_id' => $this->config['facebook']['apps']
- ],
- 'texts' => []
- ],
- 'forms' => []
- ];
- }
-