Category Covered

CakePHP tutorial

Here i am going to write a step by step beginners cakephp tutorial

This tutorial is based on cake version 2.x

CakePHP Directory Structure

/app			//This is the folder where you only work no where else
    /Config
        /Schema
            db_acl.php
            db_acl.sql
            i18n.php
            i18n.sql
            sessions.php
            sessions.sql
        acl.ini.php
        acl.php
        bootstrap.php //Always executes the file
        core.php      // You can change debug more from here
        databases.php // Database configuration here
        email.php
        routes.php    // Router url related work will be here 
    /Controller
        /Component    // Your all component will be here
            ErrorComponent.php
            YourComponentsHere.php
        AppController.php //This controller will execute always
        PagesController.php
        YourAllOtherControllersGoHere.php
    /Lib
    /Locale  		//Need for multilingual suppor
        /eng
            /LC_MESSAGES
        cake.pot
        cake_dev.pot
        default.pot
    /Model		//Your all validation will go here
        /Behavior
            YourBehaviorsHere.php
        /Datasource
            YourDatasourceHere.php
        YourModelsHere.php
    /Plugin
    /Test
        /Case
            /Controller
                /Component
            /Model
                /Behavior
            /View
                /Helper
        /Fixture
    /Vendor
    /View		//All HTML file will go here
        /Elements
            auth_error.ctp
            breadcrumb.ctp
            flash_fail.ctp
            flash_success.ctp
            your_elements_here.ctp
        /Emails		//Email templates will go here	
            /html
                default.ctp
                your_emails_here.ctp
            /text
                default.ctp
                your_emails_here.ctp
        /Errors
            error400.ctp
            error500.ctp
            your_errors_here.ctp
        /Helper
            AppHelper.ctp
        /Layouts
            /Emails
                /html
                    default.ctp
                    your_email_layouts_here.ctp
                /text
                    default.ctp
                    your_email_layouts_here.ctp
            /js
                default.ctp
            /rss
                default.ctp
            /xml
                default.ctp
            ajax.ctp
            default.ctp
            flash.ctp
            your_layouts_here.ctp
        /Pages
            home.ctp
            your_pages_here.ctp
        /Scaffolds
    /console
        /Command
            /Task
            AppShell.php
        /Templates
        cake
        cake.bat
        cake.php
    /tmp
        /cache
            /models		//Whenever you change the database you need
            /persistent	//to clear the folder
            /views
        /logs
        /sessions
        /tests
    /webroot			//This folder is the root, keep your css, js,
        /css			//images here
        /files
        /img
        /js
/lib
    /Cake			//Cakephp core library no need to change here
/plugins
/vendors

Next Step: CakePHP Naming Conventions