5

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?

3 Answers 3

4
Ensure you set your debug mode to false

in your config, app.php for cakephp3.x

'debug' => filter_var(env('DEBUG', false), FILTER_VALIDATE_BOOLEAN),

Sign up to request clarification or add additional context in comments.

Comments

3

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>

2 Comments

I still see class Post{} part up at the top.
You're likely missing your starting <?php tag on that class
1

You can disable the debug feature by turning debug to 0 in the core.php file. Regarding your second question, what do you mean exactly with "dettach any css"?

2 Comments

Like the CSS that makes it blue and stuff. Also, I changed that, but I still see class Post extends AppModel at the top.
Could you like me to the tutorial or share the code? And yes, CSS should be stored in seperate .CCS files and loaded in your HTML/PHP files.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.