本文整理匯總了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>";