Commit dd59c75d authored by Markus Sommer's avatar Markus Sommer

[TASK] Add content element data and refactor code

parent f6bad9f3
......@@ -14,19 +14,34 @@ namespace T3o\Randombanners\Controller;
* The TYPO3 project - inspiring people to share!
*/
class BannerController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController {
use T3o\Randombanners\Domain\Repository\BannerRepository;
/**
* Class BannerController
* @package T3o\Randombanners\Controller
*/
class BannerController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController
{
/**
* @var \T3o\Randombanners\Domain\Repository\BannerRepository
* @inject
*/
* @var BannerRepository
* */
protected $bannerRepository;
/**
* @return void
*/
public function indexAction() {
/**
* @return void
*/
public function indexAction()
{
$banners = $this->bannerRepository->findAll();
$this->view->assign('banners', $banners);
}
$this->view->assign('contentData', $this->configurationManager->getContentObject()->data);
}
/**
* @param BannerRepository $bannerRepository
*/
public function injectBannerRepository(BannerRepository $bannerRepository)
{
$this->bannerRepository = $bannerRepository;
}
}
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment