本文整理汇总了PHP中Restaurant::getCategories方法的典型用法代码示例。如果您正苦于以下问题:PHP Restaurant::getCategories方法的具体用法?PHP Restaurant::getCategories怎么用?PHP Restaurant::getCategories使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Restaurant
的用法示例。
在下文中一共展示了Restaurant::getCategories方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Recommendation
include "inc/includes.php";
require_once "inc/Restaurant.php";
require_once "inc/Cuisine.php";
require_once "inc/Filter.php";
global $USER_LOGGED_IN;
global $USERID;
// Generate the default recommendations if user is logged in.
if ($USER_LOGGED_IN) {
$recommendation = new Recommendation($USERID);
$filter = new Filter();
$filter->setCuisine(7);
$result = $recommendation->getFilteredWithCategory(2, $filter);
while ($reco = mysql_fetch_array($result)) {
$restaurant = new Restaurant($reco['resId']);
echo $restaurant->getName() . "," . $restaurant->getAddress();
$cuisines = $restaurant->getCategories();
foreach ($cuisines as $cuisine) {
echo $cuisine->getName();
}
}
}
?>
<html>
<body>
<?php
getFacebookWidget();
?>
</body>
</html>
示例2: Restaurant
</div>
<div>
<div class="checkbox-wrapper"><input type="checkbox" name="delievery" value="true" /> Home Delievery</div>
<div class="checkbox-wrapper"><input type="checkbox" name="pureveg" value="true" /> Pure Vegetarian</div>
<div class="checkbox-wrapper"><input type="checkbox" name="reservation" value="true" /> Takes Reservations</div>
</div>
<div class="single-block">
<a href="#" class="button black">Filter</a>
</div>
</div>
</div>
<?php
while ($reco = mysql_fetch_array($results)) {
$restaurant = new Restaurant($reco['resId']);
$cuisines = $restaurant->getCuisines();
$categories = $restaurant->getCategories();
?>
<div class="item normal" data-order='1'>
<!--BEGIN .hentry -->
<div class="hentry">
<!--BEGIN .featured-image -->
<div class="featured-image">
<a href="#"><img src="http://demo.designerthemes.com/construct/files/2011/04/3995799932_8fed63e2fc_o1-300x180.jpg" width="300" height="180" alt="" /></a>
<!--END .featured-image -->
</div>
<span class="meta-category icon-video">
<?php
示例3: foreach
if ($counter++ != 0) {
echo ", ";
}
?>
<span class="meta-category"><?php
echo $cuisine->getName();
?>
</span><?php
}
?>
<!--BEGIN .featured-post-content -->
<div class="featured-post-content">
<div class="featued-single-block">
<?php
$counter = 0;
foreach ($restaurant->getCategories() as $category) {
if ($couter++ != 0) {
echo ", ";
}
?>
<span class="category">
<a href="restaurant.php?id=<?php
echo $category->getCategoryId();
?>
" label="get recommendations for <?php
echo $category->getName();
?>
"><?php
echo $category->getName();
?>
</a></span><?php