user2417731 user2417731 -4 years ago 235
PHP Question

Take PHP Debug mode off for CakePHP

I did the CakePHP tutorial, but I get this

enter image description here

at the top and bottom. I would like to take that away.

And I have a question, when making a brand new app, do I have to deattach any css or stuff like that?

Answer Source


Remove stuff from View/Layouts/default.ctp (your default layout file)

Removing the code at the bottom:

In the View/Layouts/default.ctp (your default layout file), there is code at the bottom that shows the sql queries. Just remove it, and you'll no longer have all that data printed at the bottom:

<?php echo $this->element('sql_dump'); ?>

(It's something that should be removed anyway if you plan on using DebugKit... which you should be planning on doing.)

Removing the style in general:

As for the style (colors...etc), if you also look in the same file, you'll see (toward the top) that it includes the generic CakePHP CSS. Just remove this line to get rid of their generic styling:

echo $this->Html->css('cake.generic');

Removing the description of CakePHP:

Same file - just remove this:

<div id="header">
    <h1><?php echo $this->Html->link($cakeDescription, ''); ?></h1>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download