[TYPO3-english] Extbase an persinstance
Christian Tauscher
christian.tauscher at media-distillery.de
Sat Mar 21 12:51:55 CET 2015
Hallo.
I have written an EXTBASE Extention, now I need access to the tt_address
table.
I have etablished an extra Plugin and I want to render the List in FE
using fluid which comes very handy - But I Cant get this to work.
Maybe you can help me and ponit out my mistake, here's the Code:
TSsetup:
--------
plugin.tx_screenprinting.persistence.classes {
Tx_Screenprinting_Domain_Model_Address.mapping {
tableName = tt_address
recordType = Tx_Screenprinting_Domain_Model_Address
columns {
uid.mapOnProperty = uid
first_name.mapOnProperty = first_name
# map all the fields of tt_address
}
}
}
Q: is the recordType correct? This is guessed! I have no clue.
ext_localconf.php
-----------------
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
Tmd.' . $_EXTKEY,
'Pi2',
array(
'Address' => 'list',
)
);
Seems OK.
ext_tabels.php
--------------
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
$_EXTKEY,
'Pi2',
'Addressen (SP)'
);
Seems OK, I can access the Plugin in BE.
Classes/Controller/AddressController.php
-----------------------------------------
<?php
namespace Tmd\Screenprinting\Controller;
/**
* PrintitemController
*/
class AddressController extends
\TYPO3\CMS\Extbase\Mvc\Controller\ActionController {
/**
* printitemRepository
*
* @var \Tmd\Screenprinting\Domain\Repository\AddressRepository
* @inject
*/
protected $addressRepository = NULL;
/**
* action list
*
* @return void
*/
public function listAction() {
$addresses = $this->printitemRepository->findAll();
$this->view->assign('addresses', $addresses);
}
}
Classes/Domain/Model/Repository/AddressRepositiory.php
------------------------------------------------------
<?php
namespace Tmd\Screenprinting\Domain\Repository;
/**
* The repository for Printitems
*/
class AddressRepository extends
\TYPO3\CMS\Extbase\Persistence\Repository {
}
Resources/Private/Templates/Address/List.html
---------------------------------------------
AdressList-Test
<f:debug>{addresses}</f:debug>
Just to see if its alive.
You you tell me how to succeed with my attempt to access tt_address?
I have read a lot of examples out in the wild, but I start struggling on
the namespace/classname/lib_div-changes everything.
Thank a a lot for your help i this case.
Christian.
More information about the TYPO3-english
mailing list