HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers33/bbec.nl/app/Komma/References/ReferenceController.php
<?php

/**
 * Short description for the file.
 *
 * @author      Komma <support@komma.pro>
 * @copyright   (c) 2012-2015, Komma Mediadesign
 */

namespace Komma\References;

use Komma\Blocks\BlockService;
use Komma\Images\ImageService;
use Komma\LanguageService;
use Komma\Pages\PageService;

class ReferenceController extends \BaseController
{

    protected $pageService;
    protected $referenceService;
    public $languageService;

    public function __construct(PageService $pageService, ReferenceService $referenceService, LanguageService $languageService)
    {
        parent::__construct();
        $this->pageService = $pageService;
        $this->referenceService = $referenceService;
        $this->languageService = $languageService;
    }

    //Reference index page
    public function index(){
        //Check if language matches the url before loading content
        $this->languageService->checkRouteWithSetLanguage();

        //get content of page and get all page links
        $page = $this->pageService->getPageByCodeName('references');
        $links = $this->pageService->getAllRoutes();

        //Get all references
        $references = $this->referenceService->getAllReferences();

        return \View::make('layouts.pages.references.index')
            ->with('page', $page)
            ->with('links', $links)
            ->with('references', $references);

    }
}