How to setup CakePHP?

Discussion in 'PHP' started by shubhamjain, Jun 4, 2010.

  1. #1
    I cant understand how to setup CakePHP. I am using XAMPP on windows. I configured the config files to setup database and when I run "http://localhost/cakephp/"., I get this -

    But If I try any code in the webroot/index.php like

    I get an error that class AppModel not found. How to use it??
     
    shubhamjain, Jun 4, 2010 IP
  2. sarahk

    sarahk iTamer Staff

    Messages:
    28,901
    Likes Received:
    4,555
    Best Answers:
    123
    Trophy Points:
    665
    #2
    You don't add code to index.php - that is never touched once you have achieved the initial setup.

    The system looks for the files that are named according to the object they belong to. Therefore you should have a folder where the cakephp files are stored and in the models folder you put user.php

    I'm not familiar with Windows hosting but the general rule of cakePHP is that the app files are below the root so that they can't be called directly.
     
    sarahk, Jun 5, 2010 IP
  3. roopajyothi

    roopajyothi Active Member

    Messages:
    1,302
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    80
    #3
    roopajyothi, Jun 5, 2010 IP
  4. sarahk

    sarahk iTamer Staff

    Messages:
    28,901
    Likes Received:
    4,555
    Best Answers:
    123
    Trophy Points:
    665
    #4
    Maybe but weren't you alarmed when he said

    No "code" should be put in index.php. It shows a lack of understanding of the fundamentals of MVC and Cake in particular.
     
    sarahk, Jun 6, 2010 IP
  5. roopajyothi

    roopajyothi Active Member

    Messages:
    1,302
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    80
    #5
    roopajyothi, Jun 6, 2010 IP