+ ///Config array
+ protected $config;
+
+ ///ContainerInterface instance
+ protected $container;
+
+ ///Context array
+ protected $context;
+
+ ///Router instance
+ protected $router;
+
+ ///Translator instance
+ protected $translator;
+
+ /**
+ * Common constructor
+ *
+ * Stores container, router and translator interfaces
+ * Stores config
+ * Prepares context tree
+ *
+ * @param ContainerInterface $container The container instance
+ */
+ public function __construct(ContainerInterface $container) {
+ //Retrieve config
+ $this->config = $container->getParameter(RapsysAirBundle::getAlias());
+
+ //Set the container
+ $this->container = $container;
+
+ //Set the router
+ $this->router = $container->get('router');
+
+ //Set the translator
+ $this->translator = $container->get('translator');
+
+ //Set the context
+ $this->context = [
+ 'description' => null,
+ 'section' => null,
+ 'title' => null,
+ 'contact' => [
+ 'title' => $this->translator->trans($this->config['contact']['title']),
+ 'mail' => $this->config['contact']['mail']
+ ],
+ 'copy' => [
+ 'by' => $this->translator->trans($this->config['copy']['by']),
+ 'link' => $this->config['copy']['link'],
+ 'long' => $this->translator->trans($this->config['copy']['long']),
+ 'short' => $this->translator->trans($this->config['copy']['short']),
+ 'title' => $this->config['copy']['title']
+ ],
+ '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' => $this->translator->trans($this->config['site']['title']),
+ 'url' => $this->router->generate($this->config['site']['url'])
+ ],
+ 'canonical' => null,
+ 'alternates' => [],
+ 'facebook' => [
+ 'prefixes' => [
+ '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' => []
+ ];
+ }
+