Bonjour,

Je ne comprend pas pourquoi

echo $this->element('sql_dump');

N'affiche rien.. :(

Voila mon layout default:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
    <head>
    <!--<meta http-esquiv="Content-Type" content="text/html; charset=utf-8"/>-->
    <title><?php echo $title_for_layout; ?></title>
    <link rel="stylesheet/less" href="<?php echo $this->Html->url('/css/bootstrap.less'); ?>">
    <?php echo $this->Html->script('less'); ?>
    <?php echo $scripts_for_layout; ?>
    </head>
    <body>
        <div id="fb-root"></div> 
      <div class="navbar">
        <div class="navbar-inner">
          <div class="container" style="width: auto;">
            <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
              <span class="icon-bar"></span>
              <span class="icon-bar"></span>
              <span class="icon-bar"></span>
            </a>
            <a class="brand" href="#">Accueil</a>
            <div class="nav-collapse">
                    <?php echo $this->element('menu',array(),array('cache'=>true));?>
              </ul>
              <ul class="nav pull-right">
                <li><a href="#">Link</a></li>
                <li class="divider-vertical"></li>
                <?php if (AuthComponent::user('id')): ?>
                <li class="dropdown">
                  <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo AuthComponent::user('username'); ?><img style="width: 30px;margin-left: 12px;margin-bottom: -11px;margin-top: -13px;margin-right: 7px;border-radius: 5px;" src="<?php echo AuthComponent::user('picture'); ?>"> <b class="caret"></b></a>
                  <ul class="dropdown-menu">
                        <?php if (AuthComponent::user('role') == "admin"): ?>
                            <li>
                                <?php echo $this->Html->link("Administration",array('action'=>'pages','controller'=>'admin')); ?>
                            </li>
                            <li class="divider"></li>
                            <li>
                                <?php echo $this->Html->link("Profil",array('action'=>'pages','controller'=>'admin')); ?>
                            </li>
                            <li>
                                <?php echo $this->Html->link("Aide",array('action'=>'pages','controller'=>'admin')); ?>
                            </li>
                            <li>
                                <?php echo $this->Html->link("Préférences",array('action'=>'pages','controller'=>'admin')); ?>
                            </li>
                            <li class="divider"></li>
                        <?php endif; ?>
                        <li>
                            <?php echo $this->Html->link("Déconnexion",array('action'=>'logout','controller'=>'users')); ?>
                        </li>
                    <?php else: ?>
                      <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a>
                        <ul class="dropdown-menu">
                        <li>
                            <?php echo $this->Html->link("Se connecter",array('action'=>'login','controller'=>'users')); ?>
                        </li>
                        <li>
                            <?php echo $this->Html->link("S'inscrire",array('action'=>'signup','controller'=>'users')); ?>
                        </li>
                    <?php endif; ?>
                  </ul>
                </li>
              </ul>
            </div><!-- /.nav-collapse -->
          </div>
        </div><!-- /navbar-inner -->
      </div>

        <div class="container">
            <?php echo $this->Session->flash(); // ?> 
            <?php echo $content_for_layout; ?>
        </div>

        <h2>Session utilisateur</h2>
        <pre><?php echo debug($this->Session->read()); ?></pre>

        <footer class="footer">
          <p class="pull-right"><a href="#">Back to top</a></p>
          <p>Designed and built with all the love in the world <a href="http://twitter.com/twitter" target="_blank">@twitter</a> by <a href="http://twitter.com/mdo" target="_blank">@mdo</a> and <a href="http://twitter.com/fat" target="_blank">@fat</a>.</p>
          <p>Code licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0" target="_blank">Apache License v2.0</a>. Documentation licensed under <a href="http://creativecommons.org/licenses/by/3.0/">CC BY 3.0</a>.</p>
          <p>Icons from <a href="http://glyphicons.com">Glyphicons Free</a>, licensed under <a href="http://creativecommons.org/licenses/by/3.0/">CC BY 3.0</a>.</p>
        </footer>

        <?php debug($this->element('sql_dump')); ?>
    </body>
    <?php echo $this->Html->script('jquery'); ?>
    <?php echo $this->Html->script('bootstrap-transition'); ?>
    <?php echo $this->Html->script('bootstrap-alert'); ?>
    <?php echo $this->Html->script('bootstrap-dropdown'); ?>
    <?php echo $this->Html->script('bootstrap-scrollspy'); ?>
    <?php echo $this->Html->script('bootstrap-tab'); ?>
    <?php echo $this->Html->script('bootstrap-tooltip'); ?>
    <?php echo $this->Html->script('bootstrap-popover'); ?>
    <?php echo $this->Html->script('bootstrap-button'); ?>
    <?php echo $this->Html->script('bootstrap-collapse'); ?>
    <?php echo $this->Html->script('bootstrap-carousel'); ?>
    <?php echo $this->Html->script('bootstrap-typeahead'); ?>
    <?php echo $this->Html->script('facebook'); ?>
</html>

Quelqu'un aurait une idée?

Merci d'avance :)

2 réponses


Grafikart
Réponse acceptée

Faut faire un echo $this->element... et mettre le debug à 2

Merci Grafikart :D

très utile cette fonction pour débuguer son application.