+ Add get default param function to fetch method.

This commit is contained in:
caoyanyi
2023-06-26 09:05:15 +08:00
parent b11d4e5061
commit e79155d1a8
2 changed files with 25 additions and 4 deletions
+2 -1
View File
@@ -789,7 +789,8 @@ class baseControl
$this->app->setControlFile();
if(!is_array($params)) parse_str($params, $params);
$this->app->setParams();
$defaultParams = $this->app->getDefaultParams();
$this->app->params = $this->app->mergeParams($defaultParams, $params);
/*
* 设置要fetch的方法的参数类型。
+23 -3
View File
@@ -1545,13 +1545,13 @@ class baseRouter
}
/**
* 设置要被调用方法的参数。
* Set the params of method calling.
* 获取要被调用的方法的参数和类型。
* Get the default valve and param type of the method calling.
*
* @access public
* @return void
*/
public function setParams()
public function getDefaultParams()
{
try
{
@@ -1650,6 +1650,26 @@ class baseRouter
$defaultParams[$name] = array('default' => $default, 'type' => $type);
}
return $defaultParams;
}
catch(EndResponseException $endResponseException)
{
return array();
}
}
/**
* 设置要被调用方法的参数。
* Set the params of method calling.
*
* @access public
* @return void
*/
public function setParams()
{
try
{
$defaultParams = $this->getDefaultParams();
/**
* 根据PATH_INFO或者GET方式设置请求的参数。