mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 15:12:48 +08:00
视图配置方法config支持获取某个配置的值
This commit is contained in:
@@ -81,7 +81,7 @@ class View
|
|||||||
* @param string $value 值
|
* @param string $value 值
|
||||||
* @return View
|
* @return View
|
||||||
*/
|
*/
|
||||||
public function config($config = '', $value = '')
|
public function config($config = '', $value = null)
|
||||||
{
|
{
|
||||||
if (is_array($config)) {
|
if (is_array($config)) {
|
||||||
foreach ($this->config as $key => $val) {
|
foreach ($this->config as $key => $val) {
|
||||||
@@ -89,6 +89,9 @@ class View
|
|||||||
$this->config[$key] = $config[$key];
|
$this->config[$key] = $config[$key];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} elseif (is_null($value)) {
|
||||||
|
// 获取配置参数
|
||||||
|
return $this->config[$config];
|
||||||
} else {
|
} else {
|
||||||
$this->config[$config] = $value;
|
$this->config[$config] = $value;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user