当前位置: 首页>>代码示例>>PHP>>正文


PHP Restaurant::getCategories方法代码示例

本文整理汇总了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>
开发者ID:jainankit,项目名称:suggstme,代码行数:29,代码来源:fb.php

示例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 
开发者ID:jainankit,项目名称:suggstme,代码行数:31,代码来源:search.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 
开发者ID:jainankit,项目名称:suggstme,代码行数:31,代码来源:restaurant.php


注:本文中的Restaurant::getCategories方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。