* Modify api function for createLink.

This commit is contained in:
caoyanyi
2022-03-31 17:08:28 +08:00
parent 760b816acd
commit 2fcabdfc3f
+3 -3
View File
@@ -153,16 +153,16 @@ class helper extends baseHelper
* @access public
* @return string
*/
static public function createLink($moduleName, $methodName = 'index', $vars = '', $viewType = '', $onlyBody = false)
static public function createLink($moduleName, $methodName = 'index', $vars = '', $viewType = 'json', $onlyBody = false)
{
global $config;
$link = parent::createLink($moduleName, $methodName, $vars, 'html');
$link = parent::createLink($moduleName, $methodName, $vars, $viewType);
$pos = strpos($link, '.php');
/* The requestTypes are: GET, PATH_INFO2, PATH_INFO */
if($config->requestType == 'GET')
{
$link = '/index' . substr($link, $pos);
$link = $config->webRoot . 'index' . substr($link, $pos);
}
elseif($config->requestType == 'PATH_INFO2')
{