This function gets the datas and create an array of variables
that will be associated with the child view generated.
@return array
764801
public function front()
    {
        // Get the parameters and config from $this->pluginFrontConfig (default > hardcoded > get > post)
        $data = $this->getFormData();

        // Plugin properties
        $pageId = empty($data['pageId']) ? null : $data['pageId'];
        $moduleName = empty($data['siteModuleName']) ? getenv('MELIS_MODULE') : $data['siteModuleName'];
        $keyword = empty($data['keyword']) ? null : $data['keyword'];

        // Pagination
        $current = empty($data['current']) ? 1 : $data['current'];
        $nbPerPage = empty($data['nbPerPage']) ? 10 : $data['nbPerPage'];
        $nbPageBeforeAfter = empty($data['nbPageBeforeAfter']) ? 0 : $data['nbPageBeforeAfter'];

        $moduleDirWritable = true;
        $indexUrl = '';
        $isIndex = false;
        $siteDirExist = true;

        $moduleDirectory = '';
        $searchModulePath = self::SEARCH_PATH_MELIS_SITES;
        if (!is_null($moduleName)) {
            if (is_dir($_SERVER['DOCUMENT_ROOT'] . self::MELIS_SITES . $moduleName)) {
                /** Module is located inside MelisSites folder */
                $moduleDirectory = $_SERVER['DOCUMENT_ROOT'] . self::MELIS_SITES . $moduleName;
            } elseif (is_dir($_SERVER['DOCUMENT_ROOT'] . self::VENDOR . $moduleName)) {
                /** Module is located inside Vendor folder */
                $moduleDirectory = $_SERVER['DOCUMENT_ROOT'] . self::VENDOR . $moduleName;
                $searchModulePath = self::SEARCH_PATH_VENDOR;
            } else {
                $siteDirExist = false;
            }

            if ($siteDirExist === true) {
                if (file_exists($moduleDirectory . '/luceneIndex/indexes')) {
                    $isIndex = true;
                    $indexUrl = '';
                } else {
                    if (is_writable($moduleDirectory . '/luceneIndex/')) {
                        if (is_null($pageId)) {
                            /**
                             * Getting the current page id
                             */
                            $renderMode = $this->getController()->params()->fromRoute('renderMode');

                            if ($renderMode == 'front') {
                                $pageId = $this->getController()->params()->fromRoute('idpage');
                            } else {
                                $pageId = $data['pageId'];
                            }
                        }

                        /**
                         * Indexing Site will use the main page of the Site
                         */
                        $pageTreeSrv = $this->getServiceLocator()->get('MelisEngineTree');
                        $pageSite = $pageTreeSrv->getSiteByPageId($pageId);
                        $mainPageId = empty($pageSite->site_main_page_id) ? 1 : $pageSite->site_main_page_id;

                        // Get the current server protocol
                        $protocol = stripos($_SERVER['SERVER_PROTOCOL'], 'https') === true ? 'https://' : 'http://';

                        $indexUrl = $protocol . $_SERVER['SERVER_NAME'] . '/melissearchindex/module/' . $moduleName . '/pageid/' . $mainPageId . '/exclude-pageid/0';
                    } else {
                        $moduleDirWritable = false;
                    }
                }
            }
        }

        $searchresults = [];
        if ($isIndex && $keyword) {
            /** @var \MelisEngine\Service\MelisSearchService $searchSvc */
            $searchSvc = $this->getServiceLocator()->get('MelisSearch');
            $searchresults = $searchSvc->search($keyword, $moduleName, true, $searchModulePath);
            if (!empty($searchresults)) {
                $searchresults = str_replace('&', '&amp;', $searchresults);

                $searchresults = (Array)simplexml_load_string($searchresults);
                $searchresults = (!empty($searchresults['result'])) ? $searchresults['result'] : [];

                // Checking if the Search array result is multidimensional array or single array
                if (is_object($searchresults)) {
                    // Making the search result to be multidimensional array
                    $temp[] = $searchresults;
                    $searchresults = $temp;
                }
            }
        }

        $paginator = new Paginator(new ArrayAdapter($searchresults));
        $paginator->setCurrentPageNumber($current)
            ->setItemCountPerPage($nbPerPage)
            ->setPageRange(($nbPageBeforeAfter * 2) + 1);

        // Create an array with the variables that will be available in the view
        $viewVariables = [
            'pluginId' => $this->pluginFrontConfig['id'],
            'moduleName' => $moduleName,
            'indexerOk' => $isIndex,
            'indexerURL' => $indexUrl,
            'moduleDirWritable' => $moduleDirWritable,
            'searchresults' => $paginator,
            'nbPageBeforeAfter' => $nbPageBeforeAfter,
            'siteDirExist' => $siteDirExist,
            'searchKey' => $keyword,
        ];

        // return the variable array and let the view be created
        return $viewVariables;
    }
739971
public function getVariables()
    {
        $variables = ['search.query' => $this->catalogSearchData->getEscapedQueryText()];

        if ($layer = $this->catalogLayer) {
            $productCollection = $layer->getProductCollection();
            $variables['search.is_spellchecked'] = (int) $productCollection->isSpellchecked();
        }

        return $variables;
    }
1272249
protected function variables()
    {
        return [
            'content'   => $this->value,
            'escape'    => $this->escape,
            'label'     => $this->getLabel(),
            'wrapped'   => $this->border,
            'width'     => $this->width,
        ];
    }
923052
public function toArray()
    {
        return array_merge($this->wrappedObject->toArray(), [
            'created_at'        => $this->created_at(),
            'updated_at'        => $this->updated_at(),
            'default_view_name' => $this->default_view_name(),
        ]);
    }
255108
public function getAssignedData()
    {
        // append the internal data to the view
        $this->viewData['View'] = [
            'Title'           => $this->getTitle(),
            'TitleHtml'       => $this->getTitleHtml(),
            'Scripts'         => $this->getScripts(),
            'ScriptsHtml'     => $this->getScriptsHtml(),
            'StyleSheets'     => $this->getStyleSheets(),
            'StyleSheetsHtml' => $this->getStyleSheetsHtml(),
            'Meta'            => $this->getMeta(),
            'MetaHtml'        => $this->getMetaHtml()
        ];

        return $this->viewData;
    }
354288
public function getData()
    {
        return [
            'user___user__view_profile' => 'View user profile',
            'user___user__view_own_profile' => [
                'type' => Item::TYPE_PERMISSION,
                'description' => 'View user own profile',
                'rule' => new UpdateOwnDataRule(),
                'children' => ['user___user__view_profile']
            ],
            'user' => [
                'type' => Item::TYPE_ROLE,
                'description' => 'User',
                'children' => ['user___user__view_own_profile'],
            ],
            'admin' => [
                'type' => Item::TYPE_ROLE,
                'description' => 'Admin',
                'children' => ['user___user__view_profile']
            ],
            'owner' => [
                'type' => Item::TYPE_ROLE,
                'description' => 'Application owner',
                'children' => ['admin'],
            ]
        ];
    }
401402
public function getVariables()
    {
        return $this->variables == null?$this->variables = new SiteVariablesImpl($this->db):$this->variables;
    }
1352213
protected function getVariables(): array
    {
        $variables               = $this->getBasicVariables();
        $variables['className']  = $this->name.'Controller';
        $variables['controller'] = $this->controller;

        return $variables;
    }
875914
public function getVariables()
    {
        $variables = array_merge(
            $this->getCategoryVariables(),
            $this->getProductVariables(),
            $this->getProductListVariables(),
            $this->getLayerVariables()
        );

        return $variables;
    }
1114190
private function _dataForView()
    {
        return [
            'collection_generator' => $this->_config['collection_generator'],
            'columns'              => $this->_getColumns(),
            'collection'           => $this->_collection,
            'paginator'            => $this->_config['paginator_presenter'],
            'table'                => $this,
            'extra'                => $this->_config['extra'],
        ];
    }
957656
protected function gather_data() {
		$data = $this->factory->gather_data( $this );

		foreach ( $data as $index => $value ) {
			if ( is_array( $value ) ) {
				$this->data = array_merge( $value, $this->data );
			} else if ( is_string( $value ) && class_exists( $value ) ) {
				$class = new $value();
				$class->compose( $this );
			}
		}

		foreach ( $this->data as $key => $value ) {
			if ( $value instanceof View ) {
				$this->data[$key] = $value->render();
			}
		}

		return array_merge( $this->factory->get_shared(), $this->data );
	}
1317649
public static function getVariables()
    {
        // Suppress return by-ref
        $vars = [ 'env' => static::$env ];
        // needs to use a for loop, using `array_merge([], $GLOBALS);` left reference traces somehow
        foreach ($GLOBALS as $varName => $varValue) {
            $vars[$varName] = $varValue;
        }

        return $vars;
    }
1155606
public function getChildren()
    {
        $result = null;

        if($this->hasChildren())
        {
            $parent = $this->id;

            if(!$this->__children[$parent] instanceof DatabaseRowsetInterface)
            {
                $this->__children[$parent] = $this->getTable()->createRowset(array(
                    'data' => $this->__children[$parent]
                ));
            }

            $result = $this->__children[$parent];
        }

        return $result;
    }
530084
public function buildViewData()
    {
        $data = $this->viewData;

        if (static::$viewDataCallback) {
            $data = array_merge($data, call_user_func(static::$viewDataCallback, $this));
        }

        foreach ((new ReflectionClass($this))->getProperties(ReflectionProperty::IS_PUBLIC) as $property) {
            if ($property->getDeclaringClass()->getName() !== self::class) {
                $data[$property->getName()] = $property->getValue($this);
            }
        }

        return $data;
    }
612596
public function getData()
    {
        $data = [];

        foreach ($this->providerList as $provider) {
            $data += $provider->getData();
        }

        return $data;
    }
63791
public function getVariables() 
	{
		if(count($this->items) > 1) {
			$this->attributes['name'] .= '[]';
		}
		
		$this->attributes['type'] = 'checkbox';
		
		return array(
			'attributes' 	=> $this->attributes,
			'items'			=> $this->items,
			'selected'		=> $this->value);
	}
922071
public function getVariables() 
	{
		$this->attributes['type'] = $this->type;
		
		if(isset($this->attributes['class'])) {
			$this->attributes['class'] = trim($this
			->attributes['class'].' form-control');
		} else {
			$this->attributes['class'] = 'form-control';
		}
		
		return array('attributes' => $this->attributes);
	}