Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 327877
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T09:26:34+00:00 2026-05-12T09:26:34+00:00

I made a blog database and created some tables in it. I have wriTten

  • 0

I made a blog database and created some tables in it. I have wriTten the related models and controller files for CakePHP. Also, I have been successful in adding a test user to the blog database using Cake’s scaffolding feature. So far so good.
However, I am facing problems when getting into the Views part of Cake PHP.
I created a “default.ctp” file and placed it into apps/views/layouts folder. Following is the file:

 <html>
<head>
<title>Cake PHP Application</title>
<?=$html->css('styles');?>
</head>
<body>
<div id="container">
<div id="content">
    <?=$content_for_layout;?>
    </div>
    </div>
</body>
</html>

I have also placed the styles.css in the app/webroot/css directory. Now, when I run this in my browser, I am getting the following screen

css('styles');?>

(default) 6 queries took 14 ms
Nr  Query   Error   Affected    Num. rows   Took (ms)
1   DESCRIBE `posts`        5   5   3
2   DESCRIBE `users`        5   5   3
3   DESCRIBE `tags`     3   3   3
4   DESCRIBE `posts_tags`       3   3   3
5   SELECT COUNT(*) AS `count` FROM `posts` AS `Post` LEFT JOIN `users` AS `User` ON (`Post`.`user_id` = `User`.`id`) WHERE 1 = 1       1   1   1
6   SELECT `Post`.`id`, `Post`.`name`, `Post`.`date`, `Post`.`content`, `Post`.`user_id`, `User`.`id`, `User`.`name`, `User`.`email`, `User`.`firstname`, `User`.`lastname` FROM `posts` AS `Post` LEFT JOIN `users` AS `User` ON (`Post`.`user_id` = `User`.`id`) WHERE 1 = 1 LIMIT 20 
    2   2   1

Why is it not displaying the posts as it does using the scaffolding feature. I know it will be different than scaffolding as i am using my styles. But, why is it showing nothing?? What am I missing?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T09:26:34+00:00Added an answer on May 12, 2026 at 9:26 am

    <?= ?> are PHP short tags. Do you have short tags enabled? It doesn’t appear so. If you view the source of the page from your browser, you will see <?=$html->css('styles');?>.

    To fix this, just replace:

    <?=$html->css('styles');?>
    

    with

    <?php echo $html->css('styles'); ?>
    

    Do the same with the $content_for_layout line.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I'm going to be working on a home made blog system in PHP
Reading this blog post about HttpOnly cookies made me start thinking, is it possible
I made a view to abstract columns of different tables and pre-filter and pre-sort
I made a Java Applet with some Standard GUI Components on it. I used
I made a discovery some time back. Just follow these steps: Create a .doc/.xls/.ppt
I created the models in a Django app using manage.py inspectdb on an existing
Made solution change: I am trying to display a html table of data.. In
I made a class from Linq to SQL Clasees with VS 2008 SP1 Framework
I made a class that derives from Component: public class MyComponent: System.ComponentModel.Component { }
I made a code that translate strings to match each word from the array

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.