BannerController.php 1.36 KB
Newer Older
1
<?php
Sven Burkert's avatar
Sven Burkert committed
2
3
4
5
6
7
8
9
10
11
12
13
14
namespace T3o\Randombanners\Controller;

/*
 * This file is part of the TYPO3 CMS project.
 *
 * It is free software; you can redistribute it and/or modify it under
 * the terms of the GNU General Public License, either version 2
 * of the License, or any later version.
 *
 * For the full copyright and license information, please read the
 * LICENSE.txt file that was distributed with this source code.
 *
 * The TYPO3 project - inspiring people to share!
15
16
 */

17
use T3o\Randombanners\Domain\Repository\BannerRepository;
18
use T3o\T3oMembership\Domain\Repository\MemberRepository;
19

20
21
22
23
24
/**
 * Class BannerController
 */
class BannerController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController
{
Sven Burkert's avatar
Sven Burkert committed
25
    /**
26
27
     * @var BannerRepository
     * */
Sven Burkert's avatar
Sven Burkert committed
28
    protected $bannerRepository;
29

30
31
32
33
34
35
36
    /**
     * @param BannerRepository $bannerRepository
     */
    public function injectBannerRepository(BannerRepository $bannerRepository)
    {
        $this->bannerRepository = $bannerRepository;
    }
37
38
39
40
41

    public function indexAction()
    {
        $this->objectManager->get(\TYPO3\CMS\Core\Page\PageRenderer::class)
            ->addJsFooterFile('EXT:randombanners/Resources/Public/Javascript/randombanners.js');
42

43
44
45
46
        $this->view->assign('banners', $this->bannerRepository->findAll());
        $this->view->assign('contentData', $this->configurationManager->getContentObject()->data);
    }
}