本文整理汇总了PHP中tree::get_tree_multi方法的典型用法代码示例。如果您正苦于以下问题:PHP tree::get_tree_multi方法的具体用法?PHP tree::get_tree_multi怎么用?PHP tree::get_tree_multi使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tree
的用法示例。
在下文中一共展示了tree::get_tree_multi方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: role_perm
public function role_perm($type = 'module', $id = '')
{
$this->data['type'] = $type;
if ($id) {
$role = $this->db->where(array('roleid' => $id))->get('admin_role')->row_array();
$this->data['role'] = $role;
$role_perm = $this->data['roles'] = $this->M_user->get_admin_role_perm($id);
if ($type == 'module') {
//print_r($role_perm);
$this->data['role_perm'] = $role_perm['module'];
}
if ($type == 'category') {
require APPPATH . 'libraries/tree.class.php';
$this->load->model('M_content');
$categorys = $this->M_content->get_category();
$tree = new tree();
$tree->icon = array(' │ ', ' ├─ ', ' └─ ');
$tree->nbsp = ' ';
$str = "<tr>\n \t\t\t\t<td><label><input type='checkbox' \$checked class='ace' name='perm[]' value='\$id' /><span class='lbl'></span></label></td>\n \t\t\t\t<td>\$id</td>\n \t\t\t\t<td class='left'>\$spacer\$catname</td>\n \t\t\t</tr>";
$str2 = "<tr>\n \t\t\t\t<td><label><input type='checkbox' class='ace' name='perm[]' value='\$id' /><span class='lbl'></span></label></td>\n \t\t\t\t<td>\$id</td>\n \t\t\t\t<td class='left'>\$spacer\$catname</td>\n \t\t\t</tr>";
$tree->init($categorys);
$string = $tree->get_tree_multi(0, $str, implode(',', $role_perm['category']));
$this->data['categorys'] = $string;
}
$this->load->view('user/role_perm', $this->data);
} else {
show_error('参数异常');
}
}