本文整理汇总了PHP中Food::Get方法的典型用法代码示例。如果您正苦于以下问题:PHP Food::Get方法的具体用法?PHP Food::Get怎么用?PHP Food::Get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Food
的用法示例。
在下文中一共展示了Food::Get方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: header
$errors = Food::Delete($_REQUEST['id']);
if ($errors) {
$model = Food::Get($_REQUEST['id']);
$view = "food/delete.php";
} else {
header("Location: ?sub_action={$sub_action}&id={$_REQUEST['id']}");
die;
}
break;
case 'search_GET':
$model = Food::Search($_REQUEST['q']);
$view = 'food/index.php';
break;
case 'index_GET':
default:
$model = Food::Get();
$view = 'food/index.php';
break;
}
switch ($format) {
case 'json':
echo json_encode($model);
break;
case 'plain':
include __DIR__ . "/../Views/{$view}";
break;
case 'web':
default:
include __DIR__ . "/../Views/shared/_Template.php";
break;
}
示例2: header
$model = $_REQUEST;
$view = "food/edit.php";
}
break;
case 'edit_GET':
$model = Food::Get($_REQUEST['id']);
$view = "food/edit.php";
break;
case 'delete_GET':
$model = Food::Get($_REQUEST['id']);
$view = "food/delete.php";
break;
case 'delete_POST':
$errors = Food::Delete($_REQUEST['id']);
if ($errors) {
$model = Food::Get($_REQUEST['id']);
$view = "food/delete.php";
} else {
header("Location: ?sub_action={$sub_action}&id={$_REQUEST['id']}");
die;
}
break;
case 'search_GET':
$model = Food::Search($_REQUEST['q']);
$view = 'food/index.php';
break;
case 'index_GET':
default:
$model = Person::Get();
$view = 'persons/index.php';
break;