当前位置: 首页>>代码示例>>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;未经允许,请勿转载。