Skip to content

Instantly share code, notes, and snippets.

@markuspoerschke markuspoerschke/page.ts

Last active Dec 19, 2015
What would you like to do?
TYPO3: Using typolink in scheduler
# In your TypoScript you should add the absolute prefix
# or URL would look like this:
config.absRefPrefix = /
// ...
protected function initTsfe() {
global $TYPO3_CONF_VARS;
$id = $this->pageId;
$rootline = t3lib_BEfunc::BEgetRootLine($id);
$host = t3lib_BEfunc::firstDomainRecord($rootline);
$_SERVER['HTTP_HOST'] = $host;
$GLOBALS['TT'] = t3lib_div::makeInstance('t3lib_timeTrack');
$GLOBALS['TSFE'] = t3lib_div::makeInstance('tslib_fe', $TYPO3_CONF_VARS, $id, 0);
// ...
public function getLink($linkPid) {
$this->initTsfe(); # Call this only once! Move to constructor!
$cObj = t3lib_div::makeInstance('tslib_cObj');
$cObj->typolink_URL(array('parameter' => $linkPid));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.