+ Add get default param function to fetch method.
This commit is contained in:
@@ -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的方法的参数类型。
|
||||
|
||||
@@ -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方式设置请求的参数。
|
||||
|
||||
Reference in New Issue
Block a user