Commit 8de936e3 authored by King Alex's avatar King Alex

Ajout de fonctions recettes pour show

parent fced7102
......@@ -14,7 +14,17 @@ class RecipeController extends BaseController {
}
return View::make('templates.recipe.list')->with('recipes',$list);
}
// Returns
public function get($id){
$recipe_display = new RecipeDisplay($id); // TODO check the id here.
if(is_null($recipe_display)){
alert('Error: Recipe not found');
return $this->list();
}
return View::make('templates.recipe.show')->with('recipe',$recipe_display);
}
// Recupereration de la liste categories avec Eloquent
public function create(){
$catList = Category::all();
......@@ -27,14 +37,13 @@ class RecipeController extends BaseController {
//get keywords input for search
$keyword= Input::get('q');
var_dump('searched for : '.$keyword);
die();
return View::make('templates.recipe.list');
}
public function doCreate(){
$recipeData = Input::all();
// Creation of the recipe
$newRecipe = new Recipe;
$newRecipe->title = $recipeData['title'];
......@@ -78,7 +87,7 @@ class RecipeController extends BaseController {
$newRecipe->save();
return View::make('templates.recipe.list');
return $this->list();
}
// TODO -> Add admin panel
// TODO -> CRUD images / recipes / ingredients
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment