本文整理汇总了PHP中Recipe::getList方法的典型用法代码示例。如果您正苦于以下问题:PHP Recipe::getList方法的具体用法?PHP Recipe::getList怎么用?PHP Recipe::getList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Recipe
的用法示例。
在下文中一共展示了Recipe::getList方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Recipe
<?php
include_once 'php/config.php';
include_once 'php/basic.php';
include_once 'php/sql.php';
include_once 'php/recipe.php';
include_once 'php/user.php';
$recipes = new Recipe();
$r_data = $recipes->getList(15);
$r_html = render(__DIR__ . "/views/mr_slide.php", ["recipes" => $r_data]);
$fb_url = Config::getFbUrl();
$vk_url = Config::getVkUrl();
$header = render(__DIR__ . "/views/header.php", ["fb_url" => $fb_url, "vk_url" => $vk_url, "user" => User::getInst()->isAuthorized() ? User::getInst()->getUserInfo()["name"] : false]);
$sidebar = render(__DIR__ . "/views/sidebar.php", ["fb_url" => $fb_url, "vk_url" => $vk_url, "user" => User::getInst()->isAuthorized() ? User::getInst()->getUserInfo()["name"] . " " . User::getInst()->getUserInfo()["soname"] : false]);
$footer = render(__DIR__ . "/views/footer.php", []);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<head>
<title>FitEat</title>
<link rel="StyleSheet" type="text/css" href="stylesheets/main.css"/>
<link rel="StyleSheet" type="text/css" href="stylesheets/datepicker.css"/>
<script type="text/JavaScript" src="javascript/jquery-2.1.0.js"></script>
<script type="text/JavaScript" src="javascript/jquery-ui.min.js"></script>
<script type="text/javascript" src="javascript/datepicker.js"></script>
<script type="text/javascript" src="javascript/jquery.mask.js"></script>
<script type="text/JavaScript" src="javascript/jscript.js"></script>
</head>
示例2: intval
<?php
require_once 'config/config.conf.php';
$type = !empty($_GET['type']) ? intval($_GET['type']) : 0;
$vars = array();
if (!empty($type)) {
$vars = array('type' => array('=', $type));
}
$recipes = Recipe::getList('*', '', $vars, 'title ASC');
//$recipes = Recipe::select('SELECT * FROM recipe WHERE type = :type ORDER BY title ASC', array('type' => $type));
$count_recipes = count($recipes);
$vars = array('type' => $type, 'recipes' => $recipes, 'count_recipes' => $count_recipes);
Model::displayTemplate('recipes.tpl', $vars);