This document discusses extending TYPO3 applications using Extbase. It introduces new methods and examples for a news system. Dependency injection, signals/slots, and cached classes are presented as methods introduced with Extbase. XClass and hooks are discussed as previous methods for extending TYPO3 before Extbase. The document provides examples of mapping classes and connecting slots to demonstrate these extension techniques.
5. Xclass prima di TYPO3 6.0
ext_localconf.
php
ext:example
ux_backend.php
associazione
2
3
1dichiarazione
backend.php
typo3
3 REQUISITI
6. Xclass prima di TYPO3 6.0
3 associazione in ext_localconf.php
$GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['typo3/backend.php'] =
'typo3conf/examples/xclass/ux_backend.php'
1 dichiarazione in typo3/backend.php
if (defined('TYPO3_MODE') && $GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['typo3/backend.php']) {
include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['typo3/backend.php']);
}
2 sintassi del nome file
ux_[nome_classe].php
7. TYPO3 6.0 rompe le catene!
ext_localconf.php
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects']
['TYPO3CMSBackendControllerNewRecordController'] = array (
'className' =>
'DocumentationExamplesXclassNewRecordController'
);
Solo associazione !
8. Cambiamenti nelle classi statiche
Deprecated
t3lib_div
Use
TYPO3CMSCoreUtilityGeneralUtility
GeneralUtility::makeInstance()
GeneralUtility::callUserFunction()
GeneralUtility::getUserObj()
9. Hooks remains the same…?
Estensioni
$TYPO3_CONF_VARS['EXTCONF'][ extension_key ][ sub_key ] = value
Core
$TYPO3_CONF_VARS['SC_OPTIONS'][ main_key ][ sub_key ][ index ] = function_reference
Moduli BE
$TBE_MODULES_EXT[ backend_module_key ][ sub_key ] = value
26. Cached class
typo3temp/Cache/Code/cache_phpcode/Domain_Model_News.php
class Tx_News_Domain_Model_News extends Tx_Extbase_DomainObject_AbstractEntity {
…
…
/***********************************************************************
this is partial from: /var/www/html/typo3conf/ext/example/Classes/Domain/Model/News.php
***********************************************************************/
protected $newField;
public function getNewField() { … }
public function setNewField($newField) { … }
}
27. Estensioni per news system
➔ newsdirsync
➔ roq_newsevent
➔ mfc_author
➔ pb_news_job
➔ newsslider
➔ newsfal
➔ newsextended