我正在编写 TYPO3 扩展,并且在扩展的主要方法中我需要获取扩展的绝对路径,所以我有这段代码:
...
$extPth = t3lib_extMgm::extPath($_EXTKEY);
$tempUploadPth = $extPth.'/res/uploads';
return $tempUploadPth;
...
但是,当我运行该页面时,TYPO3 会返回此错误消息:
“TYPO3 致命错误:未加载扩展键”!
在 EM 中,我配置了扩展密钥,以下是来自的属性
本地配置文件
值得注意的是,引用同一属性的两行是重复的——我不知道这是怎么发生的。我没有手动输入它们。
$TYPO3_CONF_VARS['EXT']['extList'] = 'info,perm,func,filelist,about,tsconfig_help,context_help,extra_page_cm_options,impexp,sys_note,tstemplate,tstemplate_ceditor,tstemplate_info,tstemplate_objbrowser,tstemplate_analyzer,func_wizards,wizard_crpages,wizard_sortpages,lowlevel,install,belog,beuser,aboutmodules,setup,taskcenter,info_pagetsconfig,viewpage,rtehtmlarea,css_styled_content,t3skin,t3editor,reports,felogin,form,introduction';
$TYPO3_CONF_VARS['EXT']['extList'] = 'extbase,css_styled_content,info,perm,func,filelist,about,tsconfig_help,extra_page_cm_options,impexp,sys_note,tstemplate,tstemplate_ceditor,tstemplate_info,tstemplate_objbrowser,tstemplate_analyzer,func_wizards,wizard_crpages,wizard_sortpages,lowlevel,install,belog,beuser,aboutmodules,setup,taskcenter,info_pagetsconfig,viewpage,rtehtmlarea,t3skin,t3editor,reports,felogin,form,introduction,rsaauth,saltedpasswords,fluid,version,workspaces,scheduler,linkvalidator,automaketemplate,realurl,tt_news,indexed_search,wt_spamshield,jquerycolorbox,kickstarter,player_profile,sponzorstvo_amer'; // Modified or inserted by TYPO3 Extension Manager. Modified or inserted by TYPO3 Core Update Manager.
$TYPO3_CONF_VARS['EXT']['extList_FE'] = 'extbase,css_styled_content,install,rtehtmlarea,t3skin,felogin,form,introduction,rsaauth,saltedpasswords,fluid,version,workspaces,automaketemplate,realurl,tt_news,indexed_search,wt_spamshield,jquerycolorbox,kickstarter,player_profile,sponzorstvo_amer'; // Modified or inserted by TYPO3 Extension Manager.
如您所见,最后两行输入了键“sponzorstvo_amer”,但我仍然不知道为什么在使用全局变量 $_EXTKEY 时会出现此错误
有什么想法吗??