【问题标题】:phpfox ajax return emptyphpfox ajax 返回空
【发布时间】:2026-01-10 03:25:01
【问题描述】:

我在使用 ajax 调用时没有得到任何数据,如果没有 ajax 或者我在 ajax 中没有发送任何参数,它也可以正常工作。

这是网址 http://localhost/phpfox/index.php?do=/blog/search/keyword_lorem/zipcode_LS11%25206AU/rangevaluefrom_3/rangetype_0/submit1_1/search-id_9666aeaf80cd89b66b53f3e1af8c05fd/

ajax的代码如下

$(this).ajaxCall('blog.tagsSearch','keyword='+tags+'&encode=1&zipcode=LS11%206AU&rangevaluefrom=3&rangetype=0&view=my','GET');



<?php

Phpfox::getComponent('blog.index', array(), 'controller');
$this->html('.column_wrapper', $this->getContent(false));

?>

【问题讨论】:

  • 请检查function tagsSearch(){ }是否在\module\blog\include\component\ajax\ajax.class.php中定义
  • 未定义,现在已修复。谢谢:)

标签: ajax phpfox


【解决方案1】:

请查看\module\blog\include\component\ajax\ajax.class.php内部

function tagsSearch(){ } 已定义

class Blog_Component_Ajax_Ajax extends Phpfox_Ajax
{
    // ... other codes

    public function tagsSearch(){ 
       // ... codes for tag search
    }

    // ... more codes
 }

【讨论】: