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