本文整理汇总了PHP中category::getAll方法的典型用法代码示例。如果您正苦于以下问题:PHP category::getAll方法的具体用法?PHP category::getAll怎么用?PHP category::getAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类category
的用法示例。
在下文中一共展示了category::getAll方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loadView
public function loadView($view, $data1 = array(), $data2 = array())
{
$this->data1 = $data1;
if ($this->layout) {
ob_start();
$this->category = category::getAll();
$this->type = isset($_GET['type']) ? $_GET['type'] : 'main';
include APP_DIR . "view/" . $this->layout . ".php";
$page = ob_get_clean();
}
ob_start();
include APP_DIR . "view/" . $view . ".php";
$page_content = ob_get_clean();
$page = str_replace("[MAIN_CONTENT]", $page_content, $page);
echo $page;
}
示例2:
<?php
require_once "config.php";
$category = category::getAll();
?>
<!DOCTYPE html>
<html>
<head>
<title>Outdoor Serbia</title>
<meta name="description" content="Najnovije i najzanimljivije vesti i informacije iz sveta outdoor-a. Penjanje, Snowboard, Kite surf, Longboard, Turno biciklizam, Avanturističke trke... " />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.easing.min.js"></script>
<script type="text/javascript" src="js/jquery.nivo.slider.pack.js"></script>
<script type="text/javascript">
$(window).load(function() {
$('#slider').nivoSlider();
});
</script>
</head>
<body>
<div id="main">
<div id="site_content">
<div id="header">
<div id="menubar">
<ul id="menu">
<?php
for ($i = 0; $i < sizeof($category); $i++) {
echo "<li><a href='pocetna.html'>{$category[$i]->name}</a></li>";