當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Step::findAllSteps方法代碼示例

本文整理匯總了PHP中Step::findAllSteps方法的典型用法代碼示例。如果您正苦於以下問題:PHP Step::findAllSteps方法的具體用法?PHP Step::findAllSteps怎麽用?PHP Step::findAllSteps使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Step的用法示例。


在下文中一共展示了Step::findAllSteps方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: Recipe

<?php

require_once "models/DB.php";
require_once "models/Recipe.php";
require_once "models/Ingredient.php";
require_once "models/units_of_measure.php";
require_once "models/RecipeIngredientUnit.php";
require_once "models/IngredientLayout.php";
require_once "models/Step.php";
// Route 1: user comes here to see a specific recipe
//   get the id of the recipe they want from the query string,
//   inflate a recipe model, and show them the detail view
//make new recipy and find it based on the ID of the selected anchor
$details = new Recipe();
$details->find($viewID, $dbh);
$steps = Step::findAllSteps($dbh, $details->id);
$riu = RecipeIngredientUnit::findAllForRecipe($details->id, $dbh);
$ingredients = array();
foreach ($riu as $i) {
    //$p = new IngredientLayout();
    //$p->amount = $i->amount;
    //$p->ingredient = Ingredient::findName($i->ingredient_id,$dbh);
    //$p->unit= units_of_measure::findName($i->unit_id,$dbh);
    //$ingredients[] = $p;
}
print_r($ingredients);
require_once "views/view_recipe.php";
開發者ID:xavidram,項目名稱:RecipeListPHP,代碼行數:27,代碼來源:ShowRecipe.php

示例2: Recipe

    $editRecipe = 0;
    require_once "views/edit_recipe.php";
    die;
} else {
    if (isset($_GET['edit'])) {
        require_once "models/DB.php";
        require_once "models/Recipe.php";
        require_once "models/Ingredient.php";
        require_once "models/units_of_measure.php";
        require_once "models/Step.php";
        //pull ingredients and units of measure alphabetically from database
        $ing = Ingredient::findAll($dbh);
        $units = units_of_measure::findAll($dbh);
        $newEntry = new Recipe();
        $newEntry->find($_GET['edit'], $dbh);
        $steps = Step::findAllSteps($dbh, $_GET['edit']);
        $ingredients = Ingredient::findAllIngredients($dbh, $_GET['edit']);
        $editRecipe = 1;
        require_once "views/edit_recipe.php";
        die;
    }
}
// Route 1: user comes here to add a new recipe, show them a blank form
// Route 2: user comes here to edit a specific recipe
//   (you'll need to grab that id from the query string)
// Route 3a: user entered a new recipe details and is trying to save it
//   create an object, set values, validate and save, just like in the lab
//   if all is well, send to ShowRecipe to see the added recipe
//   otherwise, back to the edit view with errors!
// Route 3b: user updated an existing recipe details and is trying to save it
//   create an object, inflate to the proper id, update values, validate and save
開發者ID:xavidram,項目名稱:RecipeListPHP,代碼行數:31,代碼來源:EditRecipe.php

示例3: getSteps

 function getSteps()
 {
     $steps = Step::findAllSteps($dbh, $recipe_id);
     return $steps;
 }
開發者ID:xavidram,項目名稱:RecipeListPHP,代碼行數:5,代碼來源:Recipe.php


注:本文中的Step::findAllSteps方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。