[Zend_Layout] problème de compréhension du tuto
Bonjour,
Je suis en train d'apprendre ZF et j'en suis arrivé aux layout... En effet, faire des render(head) et render(foot) me parait la pire idée possible lorsqu'on veut faire une application souple. Je voudrais donc pouvoir utiliser des layout.
J'ai donc un fichier /application/views/scripts/layout.phtml
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-15" />
<title><?php echo $this->escape($this->title); ?></title>
<link rel="stylesheet" type="text/css" href="<?php echo $this->baseUrl; ?>/public/styles/site_FE.css" />
<script language="javascript" type="text/javascript" src="<?php echo $this->baseUrl; ?>/library/tiny_mce/tiny_mce.js"></script>
</head>
<body>
<div id="content">
<?php if($this->user) :?>
<p id="userbar">
Bienvenue <?php echo $this->escape($this->user->user); ?> -
<a href="<?php echo $this->baseUrl ?>/auth/logout">se déconncter</a>
</p>
<?php endif; ?>
<div id="page">
<div id="topColumn">
<?php echo $this->layout()->topColumn ; ?>
</div>
<div id="header">
<h1><?php echo $this->escape($this->title); ?></h1>
</div>
<div id="leftColumn">
<?php echo $this->layout()->leftColumn ; ?>
</div>
<div id="contentColumn">
<?php echo $this->layout()->contentColumn ; ?>
</div>
<div id="rightColumn">
<?php echo $this->layout()->rightColumn ; ?>
</div>
<div id="footer">
<p>Construction site, made for Webperso Engine</p>
</div>
</div>
<div id="credit">
<p>. . . : : Webperso Engine v4 : : . . .</p>
<p><a href="<?php echo $this->baseUrl; ?>/backend/" target="_blank">Panneau d'administration</a></p>
</div>
<?php echo $this->render('footer_FE.phtml'); ?>
</div>
</body>
</html> |
je voudrais utiliser ce fichier partout sur mon site en tant que Layout. Pour cela, il faudra charger différentes parties qu'il me reste encore à coder pour mettre dans les différents secteurs.
Voici un extrait de mon fichier index.php
Code:
1 2 3 4 5 6 7 8 9 10
|
...
// MVC
$options = array(
'layout' => 'layout',
'layoutPath' => '/application/views/scripts',
'contentKey' => 'contentColumn', // ignorés si MVC n'est pas utilisé
);
Zend_Layout::startMvc($options);
... |
et voici l'erreur qu'il me renvoie systématiquement :
Code:
1 2
|
Fatal error: Uncaught exception 'Zend_Exception' with message 'File "Layout.php" was not found' in C:\wamp\www\webperso_v_4\library\Zend\Loader.php:159 Stack trace: #0 C:\wamp\www\webperso_v_4\library\Zend\Loader.php(91): Zend_Loader::loadFile('Layout.php', Array, true) #1 C:\wamp\www\webperso_v_4\index.php(22): Zend_Loader::loadClass('Zend_Layout') #2 {main} thrown in C:\wamp\www\webperso_v_4\library\Zend\Loader.php on line 159 |
Avez vous une idée de ce que j'ai pas compris ?
Merci pour votre aide