Typo3 Extensions programmieren - Snippets: Unterschied zwischen den Versionen

Aus Wikizone
Wechseln zu: Navigation, Suche
Zeile 22: Zeile 22:
  
 
http://t3flyers.wordpress.com/2006/09/11/a-quick-guide-to-proper-caching-with-tslib_pibase-episode-1/
 
http://t3flyers.wordpress.com/2006/09/11/a-quick-guide-to-proper-caching-with-tslib_pibase-episode-1/
 +
 +
== Session Variable in Typo3 ==
 +
Session Variablen kann man folgendermaßen spreichern.
 +
  $GLOBALS["TSFE"]->fe_user->setKey("ses","$data", "$zustand");
 +
  $GLOBALS["TSFE"]->fe_user->storeSessionData();

Version vom 1. August 2008, 06:06 Uhr

Templates

Template Code holen

    function getTemplateCode($mySubpart){
        $tsTemplateFile = $this->conf['templateFile'];
        // Wenn Flextemplate dann code aus diesem, sonst aus TS
	$this->flexConf['template'] ? $templateCode = this->cObj->fileResource("uploads/tx_".$this->extKey."/".$this->flexConf['template']) : $templateCode=$this->cObj->fileResource($tsTemplateFile);
        return $templateCode;
    }

Saubere Links in Extensions erzeugen

Kommentar von Elmar Hinz:

Die Linkfunktionen der tslib_pibase sind nicht garade eine Hilfe. 2/3 davon streichen und die Extension wird 1/3 besser. Wenn Du Dich allein auf die Funktion pi_linkTP_keepPIvars konzentrierst, kannst du damit aber fast alles stemmen. Noch konsequenter wendest du gleich selbst die zugrundeliegende typolink Funktion an.

Das Thema mit dem Fokus auf ein sauberes Caching hier:

http://t3flyers.wordpress.com/2006/09/11/a-quick-guide-to-proper-caching-with-tslib_pibase-episode-1/

Session Variable in Typo3

Session Variablen kann man folgendermaßen spreichern.

 $GLOBALS["TSFE"]->fe_user->setKey("ses","$data", "$zustand");
 $GLOBALS["TSFE"]->fe_user->storeSessionData();