Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
ProjteCuisine
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
King Alex
ProjteCuisine
Commits
8de936e3
Commit
8de936e3
authored
Jan 14, 2019
by
King Alex
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ajout de fonctions recettes pour show
parent
fced7102
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
4 deletions
+13
-4
app/controllers/RecipeController.php
app/controllers/RecipeController.php
+13
-4
No files found.
app/controllers/RecipeController.php
View file @
8de936e3
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment