Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 645
user2417731 Avatar asked Nov 01 '13 01:11

user2417731


People also ask

How to debug in cakephp?

Basic DebuggingThe debug() function allows you to show the contents of a variable in a number of different ways. First, if you'd like data to be shown in an HTML-friendly way, set the second parameter to true . The function also prints out the line and file it is originating from by default.

How to hide warning in cakephp?

You are getting warnings and notice just because your DEBUG is TRUE. to solve this probem. Go to config/app. php and just change true to false as done below..


1 Answers

TLDR:

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, 'http://cakephp.org'); ?></h1>
</div>
like image 153
Dave Avatar answered Oct 09 '22 02:10

Dave