Hi,
J'ai téléchargé les fichiers source de Développer un site : Jour 3, les models et fais quelques transformations :
- Changer l'ancien lien Bootstrap de twitter ( car le lien 1.2.0 ne marche plus ) par celui-ci : Bootstrap Twitter 1.3.0 dans default.php
- Changer le nom de la base MySQL dans conf.php
Mais quand je reload la page http://localhost/testmoi/pages/1 ; elle me met deux erreurs :
- Notice: Undefined variable: pages in C:\wamp\www\testmoi\view\layout\default.php on line 15
Détails :
# Time Memory Function Location
1 0.0006 677312 {main}( ) ..\index.php:0
2 0.0028 775104 Dispatcher->__construct( ) ..\index.php:9
3 0.0033 788936 Dispatcher->error( ) ..\Dispatcher.php:19
4 0.0033 789560 Controller->e404( ) ..\Dispatcher.php:30
5 0.0033 789976 Controller->render( ) ..\Controller.php:73
6 0.0079 799616 require( 'C:\wamp\www\testmoi\view\layout\default.php' ) ..\Controller.php:36
&
- Warning: Invalid argument supplied for foreach() in C:\wamp\www\testmoi\view\layout\default.php on line 15
Détails :
# Time Memory Function Location
1 0.0006 677312 {main}( ) ..\index.php:0
2 0.0028 775104 Dispatcher->__construct( ) ..\index.php:9
3 0.0033 788936 Dispatcher->error( ) ..\Dispatcher.php:19
4 0.0033 789560 Controller->e404( ) ..\Dispatcher.php:30
Logiciels :
Wamp 2.2
Notepad++
WorkBench 5.2
Voici le default.php des fichiers source pour ceux qu'ils veulent aidé et qui ne sont pas Premium :
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title><?php echo isset($title_for_layout)?$title_for_layout:'Mon site'; ?></title>
<link rel="stylesheet" href="http://twitter.github.com/bootstrap/1.3.0/bootstrap.min.css">
</head>
<body>
<div class="topbar">
<div class="topbar-inner">
<div class="container">
<h3><a href="#">Mon site</a></h3>
<ul class="nav">
<?php foreach($pages as $p): ?>
<li><a href="<?php echo BASE_URL.'/pages/view/'.$p->id; ?>" title="<?php echo $p->name; ?>"><?php echo $p->name; ?></a></li>
<?php endforeach; ?>
</ul>
</div>
</div>
</div>
<div class="container" style="padding-top:60px;">
<?php echo $content_for_layout; ?>
</div>
</body>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
</html>
Merci :)