本文整理汇总了PHP中Menu::findAll方法的典型用法代码示例。如果您正苦于以下问题:PHP Menu::findAll方法的具体用法?PHP Menu::findAll怎么用?PHP Menu::findAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Menu
的用法示例。
在下文中一共展示了Menu::findAll方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getMenu
/**
* 根据权限生成对应的菜单
* @param type $c
* @param type $f
* @return type
*/
public function getMenu()
{
$menu = new Menu();
$a = $menu->findAll("1=1 order By pid DESC ,sort DESC");
foreach ($a as $key => $value) {
$b[] = $value->attributes;
}
$thisUrl = $this->getThisUrl();
//return $thisUrl;
$urlarr = $this->takeAllFaMenu();
$tree = $this->getTree($b, 1);
$html = $this->procHtml($tree, $thisUrl, $urlarr);
return $html;
}
示例2: nav_html
function nav_html()
{
$permiso = new Permiso();
$menu = new Menu();
$submenu = new SubMenu();
$submenu->setOrder(" ORDER BY orden");
echo "\n\t<div class='nav-wrapper blue row'>\n \t<ul id='nav-mobile' class='side-nav left'>";
foreach ($menu->findAll() as $value) {
if ($permiso->getPermisos($_SESSION['id_rol'], $value['id'])) {
echo "<li><a class='dropdown-button' href='#!' data-activates='" . $value['ver'] . "'>" . $value['ver'] . "</a></li>";
echo "<ul id='" . $value['ver'] . "' class='dropdown-content'>";
foreach ($permiso->getPermisos($_SESSION['id_rol'], $value['id']) as $valueSub) {
$m = $submenu->find($valueSub['id_submenu']);
echo "<li><a class='blue-text' href='" . $m[0]['link'] . "'>" . $m[0]['ver'] . "</a></li>";
}
echo "</ul>";
}
}
echo "\n </ul>\n <div class='opUsuario dropdown valign-wrapper right'>\n \tAdministrador<img src='img/yuna.jpg' alt='' class='circle responsive-img right' style='height:2.5rem; margin-top:1em;margin-left:1rem;'></div>\n\t</div>";
}
示例3: if
<style type="text/css">
body {padding-top: 1em; padding-bottom: 1em; overflow: auto;}
</style>
</head>
<body>
<? if (!isset($_GET['id'])) { ?>
<div class='content'><h4>Seleccione un Menú</h4></div>
<? } else { ?>
<? if ($per[0]['crear']==1) { button_add_modal_in("#new"); ?>
<div id="new" class="modal">
<h4>Ingresar SubMenú</h4>
<form action="?op=insert" method="POST" class="row">
<div class="input-field col s4" >
<select class='tableInput' name='id_menu' id='id_menu' <? if ($per[0]['editar']==0) echo "disabled"; ?> required>
<?php
foreach ($menu->findAll() as $e) {
?>
<option value='<? echo $e['id']; ?>' <? if($e['id']==$value['id_menu']) echo "selected"; ?>><? echo $e['ver']; ?></option>
<?php
}
?>
</select>
<label for='id_menu'>Menú Principal:</label>
</div>
<div class="input-field col s4" >
<input type="text" name="ver" id='ver' class='validate' required>
<label for='ver'>Texto para mostrar en Menú:</label>
</div>
<div class="input-field col s4" >
<input type="text" name="link" id='link' class='validate' required>
<label for='name'>Link:</label>
示例4: foreach
echo Html::a($takonomy['name'], ['/' . $moduleId . '/default/list', 'takonomy' => $takonomy['id']]);
?>
</li>
<?php
}
?>
</ul>
</div>
<?php
}
?>
<ul class="nav">
<li id="menu-item-2333" class="menu-item menu-item-type-custom menu-item-object-custom current-menu-item current_page_item menu-item-home menu-item-2333"><a href=".">首页</a></li>
<?php
foreach (Menu::findAll(['category_id' => 'main', 'parent_id' => 0], 'sort_num desc') as $menu) {
?>
<li id="menu-item-<?php
echo $menu['id'];
?>
" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-<?php
echo $menu['id'];
?>
"><a href="<?php
echo $menu['url'];
?>
"><?php
echo $menu['name'];
?>
</a></li>
<?php
示例5: getList
public static function getList($pid)
{
$model = new Menu();
$criteria = new CDbCriteria();
$criteria->addCondition("pid={$pid} and is_show=1");
$criteria->order = 'orderid ASC';
$list = $model->findAll($criteria);
return $list;
}
示例6: isset
<?php
$page = isset($_GET['page']) ? $_GET['page'] : 1;
if (!preg_match('/^\\d+$/', $page)) {
dispatch('core/backend/404');
exit;
}
$objects = Menu::findAll();
$html = new HTML();
$html->renderOut('core/backend/html_header', array('title' => i18n(array('en' => 'Menu', 'zh' => '菜单'))), true);
$html->output('<div id="wrapper">');
$html->renderOut('core/backend/header');
$perpage = 50;
$total = Menu::countAll();
$total_page = ceil($total / $perpage);
$html->renderOut('menu/backend/menu_list', array('objects' => Menu::findAllWithPage($page, $perpage), 'current_page' => $page, 'total_page' => $total_page, 'total' => $total, 'pager' => $html->render('core/components/pagination', array('total' => $total_page, 'page' => $page)), 'start_entry' => ($page - 1) * $perpage + 1, 'end_entry' => min(array($total, $page * $perpage))), true);
$html->output('</div>');
$html->renderOut('core/backend/html_footer');
exit;