So bin kaum weiter gekommen, habe viele Varianten aus dem Forum versucht.
So ich beschreibe mal kurz mein Vorgehen.
Ich habe eine Controller php erstellt:
class blabla_details_foodinformations_parent extends oxUBase
{
protected $_sThisTemplate=“blabla_details_foodinfo.tpl”;
protected $_aViewData = array();
public function render() {
parent::render();
$this->getOneTableTestRow();
return $this->_sThisTemplate;
}
public function getFoodInfo()
{
$oblabla_details_foodinfoList= oxNew("blabla_details_foodinfoList");
$oblabla_details_foodinfoList->selectString("select oxid, blabla_energie from blablafoodinformations");
return $oblabla_details_foodinfoList>getArray();
}
public function getOneTableTestRow()
{
$oTableTestRow= oxNew("blabla_details_foodinfoClass");
$oTableTestRow = oxDb::getDb()->Execute("select oxid, blabla_energie from blablafoodinformations");
$this->_aViewData['blabla_energie'] = $oTableTestRow;
}
}
Dazu 2 core Klassen eine in _core.php die andere in _list.php
_core.php:
class blabla_details_foodinfoClass extends oxBase
{
// Name der Tabelle
protected $_sCoreTbl = ‘blablafoodinformations’;
// Name der Klasse
protected $_sClassName = 'blabla_details_foodinfoClass';
public function __construct()
{
parent::__construct();
$this->init( 'blablafoodinformations', true );
}
}
_list.php:
class blabla_details_foodinfoList extends oxList
{
public function __construct( $sObjectsInListName = ‘blablafoodinformations’)
{
return parent::__construct( ‘blabla_details_foodinfoClass’);
}
}
Meine TPl ->Block
[{$smarty.block.parent}]
[{block name=“blabla_details_foodinformations”}]
[{capture append=“tabs”}]<a href="#details_foodinformations">
[{oxmultilang ident=“FOODINFORMATION”}]</a>
[{/capture}]
[{capture append=“tabsContent”}]
<div class=“blabla_details_foodinformations” id=“blabla_details_foodinformations”>
[{foreach from=$oView->getFoodInfo() item=oProject}]
[{$oProject->blablafoodinformations__oxid->value}]
[{$oProject->blablafoodinformations__sa_energie->value}]
[{/foreach}]
[{debug}]
</div>
[{/capture}]
[{/block}]
In der metadata habe ich die so eingebunden:
‘files’ => array(
‘blabla_details_foodinfo’ => ‘blabla/blabla_details_foodinformations/controllers/blabla_details_foodinfo.php’,
‘blabla_details_foodinfo_core’ => ‘blabla/blabla_details_foodinformations/models/blabla_details_foodinfo_core.php’,
‘blabla_details_foodinfo_list’ => ‘blabla/blabla_details_foodinformations/models/blabla_details_foodinfo_list.php’,
),
'blocks'=> array(
array(
//Frontend
'template' =>'page/details/inc/tabs.tpl',
'block' =>'details_tabs_longdescription',
'file' =>'blabla_details_foodinfo.tpl',
),
Ich komme seit Tagen leider nicht weiter bekomme als Fehlermeldung folgendes:
Function ‘getFoodInfo’ does not exist or is not accessible! (oxwArticleDetails)