[TYPO3-english] Cannot get getTypoLink_URL function to work in my eID extension

Benoit Montereau bmontereau at gmail.com
Thu Jun 6 00:33:11 CEST 2013


I'm runnign Typo3 4.7.4

In order to execute ajax call through my Typo3 website, I just added my own
"extension" as an "eID_include".

Everything issetup and working fine (also databse connection & queries) as
long as my extension is not trying to call Typo3 function.

My extension should return a link definition as a string and I cannot get
the getTypoLink_URL to work.

As soon as I added in the init() function of my class the

$TSFEObject = tslib_eidtools::getTSFE(); I get an error http 500

Same error, occurs if this line is not present and I try to get the link
definition using.

So is it definitely not possible to call this function in my own eID
extension or am I doing something wrong here?

Thank you in advance for your help.
Ben



<?php
if (!defined ('PATH_typo3conf')) die ('Could not access this script
directly!');

require_once(PATH_tslib. 'class.tslib_pibase.php');
require_once(PATH_t3lib . 'class.t3lib_befunc.php');
require_once(PATH_t3lib . 'stddb/tables.php');
require_once(t3lib_extMgm::extPath('cms', 'ext_tables.php'));

class tx_cascade_page_eid extends tslib_pibase {
public function init() {
 // initiate feobject
$this->feUserObj = tslib_eidtools::initFeUser();
//$TSFEObject = tslib_eidtools::getTSFE();
// initiate database
tslib_eidtools::connectDB();
}
public function main() {
// get params for query
 $param = t3lib_div::_GET();
$st = $param['st'];
if($st > 3){
return;
}
$name = $param['name'];

$pageid = 469;
// $href = $GLOBALS['TSFE']->cObj->getTypoLink_URL($pageid);
$href = $this->cObj->getTypoLink_URL($pageid);
echo "hello world $name / $href";
 }
}

if (defined('TYPO3_MODE') &&
isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/cascade_page/class.tx_cascade_page_eid.php']))
{
include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/cascade_page/class.tx_cascade_page_eid.php']);
}

$module = t3lib_div::makeInstance('tx_cascade_page_eid');
$module->init();
$module->main();
?>


More information about the TYPO3-english mailing list