我有TYPO3 7.6.18,我在前端尝试使用ajax,但收到错误消息“无法确定扩展名\“ fefiles \”和插件\“ piphoto \”的默认控制器“。

setup.txt

ajaxCall = PAGE
ajaxCall {
   typeNum = 22222
   config {
    disableAllHeaderCode = 1
    xhtml_cleaning = 0
    admPanel = 0
    additionalHeaders = Content-type: text/plain
    no_cache = 1
    debug = 0
   }
   10 = USER
   10 {
        userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
        extensionName = fefiles
        pluginName = Piphoto
        vendorName = Istar
        controller = Photo
        action = ajaxHandler
   }
}


ext_tables.php

\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
    $_EXTKEY,
    'Piphoto',
    'Upload Photo'
);


js

jQuery(function($) {
    $(".send-photo-comment").click(function (e) {
        e.preventDefault();
        $.ajax({
            type: "POST",
            url: "?id=0&type=22222",
            data: {},
            success: function(msg){
                console.log(msg);
            }
        });
    })
})


ext_localconf

\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
    'Istar.' . $_EXTKEY,
    'Piphoto',
    [
        'Photo' => 'list, ajaxHandler, show, new, create, edit, update, delete',
    ],
    // non-cacheable actions
    [
        'Photo' => 'list, ajaxHandler, show, new, create, edit, update, delete',
    ]
);

Help me please)

最佳答案

您的ext_localconf.php看起来如何?
应该包括以下内容:

\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
    'Istar.' . $_EXTKEY,
    'Piphoto,
    array(
        'Photo' => 'ajaxhandler'
    )
);

09-19 19:22