当前位置: 首页>>代码示例>>PHP>>正文


PHP AdminPage::assignTemplate方法代码示例

本文整理汇总了PHP中AdminPage::assignTemplate方法的典型用法代码示例。如果您正苦于以下问题:PHP AdminPage::assignTemplate方法的具体用法?PHP AdminPage::assignTemplate怎么用?PHP AdminPage::assignTemplate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AdminPage的用法示例。


在下文中一共展示了AdminPage::assignTemplate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: assignTemplate

 protected function assignTemplate()
 {
     parent::assignTemplate();
     $this->useGlitter('source-list');
     $this->vars['page_type'] = 'cluster-admin';
     $this->vars['clusters'] = $this->clusters;
     $this->vars['hosts'] = $this->hosts;
     $this->vars['source_list_cookie'] = 'cluster';
     if (isset($this->vars['global_nav']['cluster'])) {
         $this->vars['global_nav']['cluster']['class'] .= ' active';
     }
     $this->vars['source_list'] = array('clusters' => array('name' => 'Clusters', 'children' => array()), 'hosts' => array('name' => 'Hosts', 'children' => array()));
     foreach ($this->clusters as $name => $cluster) {
         $this->vars['source_list']['clusters']['children'][$name] = array('name' => $cluster['title'], 'link' => $this->request->base . '-/' . $name, 'class' => 'cluster', 'children' => array());
         $instances = $this->model->instancesInCluster($name);
         foreach ($instances as $iname => $inst) {
             $this->vars['source_list']['clusters']['children'][$name]['children'][$iname] = array('name' => $inst['title'], 'link' => $this->request->base . '-/' . $name . '/' . $iname, 'class' => 'instance');
         }
     }
     foreach ($this->vars['hosts'] as $name => $info) {
         $this->vars['source_list']['hosts']['children'][$name] = array('name' => $name, 'link' => $this->request->base . 'host/-/' . $name, 'class' => 'host', 'children' => array());
     }
 }
开发者ID:nexgenta,项目名称:cluster,代码行数:23,代码来源:app.php


注:本文中的AdminPage::assignTemplate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。