1
votes

I am attempting to start a new cakePHP project under my ~/Sites/cakeapps/cakephp

folder structure. I was able to using the cake bake command create a new project and it placed the project inside my /cakephp directory. My project file structure now looks like this.

/cakeapps/cakephp/app/<Project>/

i have followed the tutorial and i have my database.php file configured, core.php configured and created a custom controller <IjazaController> that extends the AppController. This file

class IjazaController extends AppController {


    function beforeFilter(){
        parent::beforeFilter();
    }

    public  function  index(){

    }
}

has a corresponding index.ctp file under /View/Ijaza/index.ctp. When i try to browse to this url http://localhost/cakephp/ijaza/ i end up with an error:

Error: CakephpController could not be found.

Error: Create the class CakephpController below in file: cakephp/Controller/CakephpController.php

<?php
class CakephpController extends AppController {

}

I am not sure why my url routing does not find the index.ctp file, i am using a mac with XAMPP

1

1 Answers

0
votes

You mixed something up: The folder cakephp is not required.

Rearrange your folders into this structure, where yourproject is the name of your project (or copy of the app folder...):

~/Sites/ 
~/Sites/cakephp/ --> The cakephp library
~/Sites/cakephp/yourproject/ --> Your application code 

Example

~/Sites/cakephp/plugins/
~/Sites/cakephp/vendors/
~/Sites/cakephp/lib/Cake/bootstrap.php
...

~/Sites/cakephp/yourproject/Config/core.php
...
~/Sites/cakephp/yourproject/Controller/IjazaController.php
...
~/Sites/cakephp/yourproject/View/Ijaza/index.ctp