Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
SCHULER_VISENTINI_KBIDA_TARDIEU_BDD_Applications_S4
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
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
SCHULER Killian
SCHULER_VISENTINI_KBIDA_TARDIEU_BDD_Applications_S4
Commits
08e0d97e
Commit
08e0d97e
authored
Mar 04, 2020
by
Safyrus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modif index + add view
parent
fb5bfef4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
74 additions
and
3 deletions
+74
-3
tp1/src/index.php
tp1/src/index.php
+7
-3
tp1/src/vue/RequeteVue.php
tp1/src/vue/RequeteVue.php
+67
-0
No files found.
tp1/src/index.php
View file @
08e0d97e
<?php
use
bdd\controleur\ControleurRequete
;
use
Illuminate\Database\Capsule\Manager
as
DB
;
$db
=
new
DB
();
//SI CA NE FONCTIONNE PAS, ENLEVER LES COMMENTAIRES : CES INFOS SONT DEJA DANS LE CONF.INI
...
...
@@ -30,10 +32,8 @@ $db->addConnection([
$db
->
setAsGlobal
();
$db
->
bootEloquent
();
// demerage d'un session
session_start
();
// intance de slim qui a pour but de créer le rootage des urls
$app
=
new
Slim
();
$app
->
get
(
'/'
,
function
()
{
...
...
@@ -41,15 +41,19 @@ $app->get('/', function () {
$v
->
renderHome
();
})
->
name
(
'accueil'
);
$app
->
get
(
'/ex1/requete1'
,
function
()
{
$c
=
new
ControleurRequete
();
$c
->
selectMario
();
})
->
name
(
'ex1 requete 1'
);
$app
->
get
(
'/ex1/requete2'
,
function
()
{
$c
=
new
ControleurRequete
();
})
->
name
(
'ex1 requete 2'
);
$app
->
get
(
'/ex1/requete3'
,
function
()
{
$c
=
new
ControleurRequete
();
})
->
name
(
'ex1 requete 3'
);
$app
->
get
(
'/ex1/requete4'
,
function
()
{
$c
=
new
ControleurRequete
();
})
->
name
(
'ex1 requete 4'
);
...
...
tp1/src/vue/RequeteVue.php
0 → 100644
View file @
08e0d97e
<?php
use
Slim\Slim
;
class
Requete1
{
protected
$tab
,
$app
;
public
function
__construct
(
$t
)
{
$this
->
tab
=
$t
;
$this
->
app
=
Slim
::
getInstance
();
}
public
function
render
(
$type
)
{
switch
(
$type
)
{
case
1
:
return
$this
->
selectMario
();
break
;
default
:
return
$this
->
notFound
();
break
;
}
}
private
function
notFound
()
{
$res
.=
<<<RES
<!doctype html>
<html lang="fr">
<head>
<meta charset="utf-8">
</head>
<body>
<p>data not found</p>
</body>
</html>
RES;
}
private
function
selectMario
()
{
$res
.=
<<<RES
<!doctype html>
<html lang="fr">
<head>
<meta charset="utf-8">
</head>
<body>
RES;
foreach
(
$this
->
tab
as
$key
=>
$value
)
{
$res
.=
<<<RES
$key:$value
RES;
}
$res
.=
<<<RES
</body>
</html>
RES;
return
$res
;
}
}
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