[TYPO3-dev] New Extension does not show anything
Dirk Ho
dirk_studivz at web.de
Sun Jun 29 21:59:51 CEST 2014
Hi all,
I tried to create a new extension with the Extension Builder extension.
Aggregate Root is a Model called "Category", having a n:1 relation to
"Forum" ("Forum has a n:1 relation to "Topic", "Topic" has a n:1
relation to "Post").
I added the extension "Forumlisting" to a page named "Forum". When I now
call "Forum" nothing is shown (except the page's template). I already
cleared Cache,... but it didn't work.
Any idea, what I do wrong? When i put file_put_contents to
CategoryController's list method this file is not written.
/var/log/apache2/error.log does not show any error.
Beneath I posted some code/config information. Do you need additional
information?
Thanks and best wishes,
Dirk
My ext_localconf.php looks like that:
<?php
if (!defined('TYPO3_MODE')) {
die('Access denied.');
}
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'DH.' . $_EXTKEY,
'Forumlisting',
array(
'Category' => 'list',
),
// non-cacheable actions
array(
'Category' => 'list',
)
);
My Category Controller looks like:
<?php
namespace DH\Forum\Controller;
/**
* CategoryController
*/
class CategoryController extends
\TYPO3\CMS\Extbase\Mvc\Controller\ActionContro$
/**
* categoryRepository
*
* @var \DH\Forum\Domain\Repository\CategoryRepository
* @inject
*/
/**
* @var \TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager
* @inject
*/
protected $persistenceManager;
/**
* action list
*
* @return void
*/
public function listAction() {
file_put_contents('/var/www/supporters-karlsruhe.de/log.log', 'TEST');
for ($i = 0; $i <= 3; $i++) {
$category =
$this->objectManager->get('\\DH\\Forum\\Domain\\Model\\Category');
$category->setTitle('A'.$i);
$category->setDescription('A');
$category->setOrderId($i);
$category->setCreatedAt(now());
}
$this->persistenceManager->persistAll();
$categories = $this->categoryRepository->findAll();
$this->view->assign('categories', $categories);
}
}
My Resources\Private\Template\Category\List.html looks like
<ul class="category-list">
<f:for each="{categories}" as="category}>
<li>{category.title}</li>
</f:for>
</ul>
More information about the TYPO3-dev
mailing list