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
bdaa72c2
Commit
bdaa72c2
authored
Mar 25, 2020
by
Nathan
Browse files
Merge remote-tracking branch 'origin/master'
parents
268f78d9
6621c7cd
Changes
4
Hide whitespace changes
Inline
Side-by-side
Seance5-6/seance/index.php
View file @
bdaa72c2
...
...
@@ -27,6 +27,7 @@ $app->get('/api/games/',function() {
$app
->
run
();
//echo "<a href='Question1.php'>question 1 -- afficher (name, deck) les personnages du jeu 12342</a><br>";
...
...
Seance5-6/seance/src/controller/IndexController.php
View file @
bdaa72c2
...
...
@@ -17,11 +17,24 @@ class IndexController
}
public
static
function
partie2
()
{
$game
=
Game
::
select
(
'id'
,
'name'
,
'alias'
,
'deck'
)
->
where
(
'id'
,
'<='
,
'200'
)
->
get
();
// $game = Game::where('id','=',1)->get();
// $json = json_encode($game,JSON_FORCE_OBJECT);
$json
=
'{ "games" : [ '
;
foreach
(
$game
as
$key
=>
$value
)
{
$json
=
$json
.
'"game" :{'
;
$json
=
$json
.
json_encode
(
$value
)
.
',},"links" :{"self": {"href":"/api/games/'
.
$value
->
id
.
'"}}'
;
}
$json
=
$json
.
']}'
;
$cq2
=
new
CQuestion2
(
$json
);
$cq2
->
render
();
/*
$game = Game::select('id','name','alias','deck')->where('id','<=','200')->get();
// $game = Game::where('id','=',1)->get();
// $json = json_encode($game,JSON_FORCE_OBJECT);
$json
=
'{ "games" : [ '
;
foreach($game as $key => $value) {
<<<<<<< HEAD
$json = $json . json_encode($value) . ',';
/*$json = $json . '{
"id": ' . $value->id . ',
...
...
@@ -36,12 +49,18 @@ class IndexController
"name":' . $value->name . ',
"deck":' . $value->deck . ',
}
';
*/
';
}
}
$json = $json . ']}';
=======
$value->description = "...";
}
$json = json_encode($game);
>>>>>>> e2c791070c5330916f63fb55c2b639a71a327bcb
$cq2 = new VuePartie2($json);
$cq2
->
render
();
$cq2->render();
*/
}
}
\ No newline at end of file
Seance5-6/seance/src/view/VuePartie1.php
View file @
bdaa72c2
...
...
@@ -12,21 +12,21 @@ class VuePartie1
$json
=
json_encode
(
$game
);
$this
->
content
=
<<<
END
<!
DOCTYPE
html
>
<
html
lang
=
"fr"
>
<
head
>
<
meta
charset
=
"UTF-8"
content
=
"application/json"
>
<
link
rel
=
"stylesheet"
href
=
"css/main.css"
>
<
title
>
photobox
</
title
>
</
head
>
<!
DOCTYPE
html
>
<
html
lang
=
"fr"
>
<
head
>
<
meta
charset
=
"UTF-8"
content
=
"application/json"
>
<
link
rel
=
"stylesheet"
href
=
"css/main.css"
>
<
title
>
photobox
</
title
>
</
head
>
<
body
>
<
body
>
$json
$json
</
body
>
</
body
>
END
;
...
...
Seance5-6/seance/src/view/VuePartie2.php
View file @
bdaa72c2
...
...
@@ -21,12 +21,11 @@ class VuePartie2
<
link
rel
=
"stylesheet"
href
=
"css/main.css"
>
<
title
>
photobox
</
title
>
<
title
>
AppliBD
</
title
>
</
head
>
<
body
>
<
h1
>
Titre
</
h1
>
<
p
>
$json
</
p
>
$json
</
body
>
END
;
...
...
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