Slide 26
Slide 26 text
class
tx_myext_pi1
extends
tslib_pibase
{
public
function
main($conf,
$content)
{
$mainTemplate
=
$this-‐>cObj-‐>fileResource(...);
$rowTemplate
=
$this-‐>cObj-‐>fileResource(...);
$userRes
=
$GLOBALS['TYPO3_DB']-‐>exec_SELECTquery(
'*',
'tx_myext_users',
'deleted=0
AND
active=1'
);
while($user
=
$GLOBALS['TYPO3_DB']-‐>sql_fetch_assoc($userRes))
{
$markers
=
[
"###NAME###"
=>
$user['name'],
"###EMAIL###"
=>
$user['email']
];
$content
.=
$this-‐>cObj-‐>substituteMarkerArray(
$rowTemplate,
$markers
);
}
$markers
=
['###USERS###'
=>
$content];
return
$this-‐>cObj-‐>substituteMarkerArray($mainTemplate,
$markers);
}
}