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

  • Home
  • SEARCH
  • 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 7445855
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T12:08:32+00:00 2026-05-29T12:08:32+00:00

I building my first cake PHP application, all things configured correctly, but when i

  • 0

I building my first cake PHP application, all things configured correctly, but when i calling to model on controller as below it gives an error message when i browse this url on localhost

class NotesController extends AppController{
var $name = "Notes";

function index(){
    $this->set('notes',$this->Note->find('all'));
}
}

this gives an error like this.
Parse error: syntax error, unexpected T_STRING, expecting T_FUNCTION in D:\wamp\www\cakephp\app\Model\note.php on line 4

my model file has follow codes

class Note extends AppModel{
  $name = "Note";
}

i think db connection and other configurations are ok,please any one can help me, i ll highly appreciated you. thanks lot….

  • 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-29T12:08:33+00:00Added an answer on May 29, 2026 at 12:08 pm

    Change:

    $name = "Note";
    

    To:

    var $name = "Note";
    

    or:

    public $name = "Note";
    

    CakePHP recommends using var to keep code compatible with PHP4. However, this is completely unnecessary and it’s better to use public.

    That being said, the code you posted should not give an unexpected T_STRING error but, rather, an unexpected T_VARIABLE error. So there may be something else going on as well.

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

Sidebar

Related Questions

Building my first SL MVVM application (Silverlight4 RC) and have some issues i don't
I'm building my first ASP.NET MVC application and I am having some troubles with
My team is building our first significant Silverlight application, using a 3 layered architecture
I'm building my first Facebook Connect application, and am running into an odd problem.
I'm building my first real rails application for a little in-house task. Most of
I am building my first .NET MVC web application and loving the simplicity and
Just building my first WinForms application. Question - What's the easiest/best approach for saving
Hi I'm building my first MVC 2 app and I'm really confused by all
I'm building my first application that requires a calendar. I have it working great
I am building my first ASP.net MVC application (not my first jQuery & jQuery

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.