本文整理汇总了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());
}
}