Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
KELBERT Paul
ApplicationsBD_CHEVALIER_TONDON_KELBERT
Commits
183568ec
Commit
183568ec
authored
Mar 25, 2020
by
Nathan
Browse files
Auto stash before merge of "master" and "origin/master"
parent
bdaa72c2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Seance5-6/seance/index.php
View file @
183568ec
...
...
@@ -25,6 +25,10 @@ $app->get('/api/games/',function() {
IndexController
::
partie2
();
})
->
name
(
'partie2'
);
$app
->
get
(
'/api/games/:id/comments'
,
function
()
{
IndexController
::
partie5
();
})
->
name
(
'partie5'
);
...
...
Seance5-6/seance/src/controller/IndexController.php
View file @
183568ec
...
...
@@ -62,5 +62,22 @@ class IndexController
$cq2->render();*/
}
public
static
function
partie5
(
$id
){
$comment
=
Commentary
::
select
(
'id'
,
'titre'
,
'contenu'
,
'dateCreation'
,
'userID'
)
->
where
(
'jeuConcerne'
,
'='
,
$id
)
->
get
();
$json
=
'{ "comments" : ['
;
foreach
(
$comment
as
$c
){
if
(
$c
===
array_key_last
(
$$comment
)){
$json
=
$json
.
']}'
;
}
else
{
$json
=
$json
.
json_encode
(
$c
)
.
','
;
}
}
$vue
=
new
VuePartie2
(
$json
);
$vue
->
render
();
}
}
\ No newline at end of file
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