mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-01 15:32:48 +08:00
databrage增加强制转对象参数;
This commit is contained in:
@@ -110,8 +110,8 @@ class AdminControllerBase extends BaseController
|
||||
*/
|
||||
protected function initialize()
|
||||
{
|
||||
if(empty($this->pageKeyName)){
|
||||
$this->pageKeyName = $this->request->controller().'_'. $this->request->action();
|
||||
if (empty($this->pageKeyName)) {
|
||||
$this->pageKeyName = $this->request->controller() . '_' . $this->request->action();
|
||||
}
|
||||
|
||||
parent::initialize();
|
||||
@@ -138,10 +138,10 @@ class AdminControllerBase extends BaseController
|
||||
* @param mixed $value 变量值
|
||||
* @return mixed
|
||||
*/
|
||||
public function assign($name, $value = null, $isAppendToDataBrage = false)
|
||||
public function assign($name, $value = null, $isAppendToDataBrage = false, $forceObject = false)
|
||||
{
|
||||
if ($isAppendToDataBrage) {
|
||||
$this->dataBrage[$name] = $value;
|
||||
$this->setDataBrage($name, $value, $forceObject);
|
||||
}
|
||||
|
||||
return $this->app->view->assign($name, $value);
|
||||
@@ -185,9 +185,9 @@ class AdminControllerBase extends BaseController
|
||||
$vars['content_js'] = $this->fetchJS($template);
|
||||
|
||||
$content_main = View::layout($this->layout)
|
||||
->config([
|
||||
'view_suffix' => 'html',
|
||||
])->fetch($template, $vars);
|
||||
->config([
|
||||
'view_suffix' => 'html',
|
||||
])->fetch($template, $vars);
|
||||
|
||||
$html = '';
|
||||
$html .= $content_main;
|
||||
@@ -202,8 +202,12 @@ class AdminControllerBase extends BaseController
|
||||
* @param mixed $value
|
||||
* @return void
|
||||
*/
|
||||
public function setDataBrage($name, $value)
|
||||
public function setDataBrage($name, $value, $forceObject = false)
|
||||
{
|
||||
if ($forceObject && !is_object($value)) {
|
||||
$value = (object) $value;
|
||||
}
|
||||
|
||||
$this->dataBrage[$name] = $value;
|
||||
|
||||
return $this;
|
||||
@@ -370,12 +374,10 @@ class AdminControllerBase extends BaseController
|
||||
'autoloadJs' => $autoloadJs,
|
||||
'isSuperAdmin' => $isSuperAdmin,
|
||||
'version' => env('app_debug') ? time() : sysconfig('site', 'site_version'),
|
||||
'pageKeyName'=>$this->pageKeyName
|
||||
'pageKeyName' => $this->pageKeyName,
|
||||
];
|
||||
|
||||
View::assign($data);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user