Contents

About the Author

About the Technical Reviewer

Acknowledgments

CHAPTER 1 Introduction

                       From Novice to Professional

                       Why Cake?

                             It's PHP!

                             Rapid Development

                             Model-View-Controller

                             CRUD Operations and the Bake Script

                             Scaffolding

                             Helpers

                             Customizable Elements

                             Large Community

                             More Features

                       Summary

PART 1     Getting Started

CHAPTER 2 Installing and Running CakePHP

                       A Simple Start: Running Cake on a Localhost Environment

                             Getting Cake

                             Launching Cake

                       Running the Setup Routines

                             Preparing the tmp Folder for Cake to Read and Write Temp Files

                             Changing the Security.salt Value

                             Entering MySQL Connection Settings

                             Designing Your Database Schema

                       Summary

CHAPTER 3 Creating a To-Do List Application

                       Exploring the MVC Structure

                             The To-Do List's MVC Layout

                       Designing and Creating the Database

                       Creating Models

                             What's Happening in This Model

                             Model Possibilities

                       Creating Controllers

                             What's Happening in This Controller

                             Controller Possibilities

                       Launching the Application

                             How Cake Resolves URLs

                       Creating the Scaffolding

                       Summary

PART 2     Developing CakePHP Applications

CHAPTER 4 Naming Files and Designing the Database

                       Convention Over Configuration

                             Intercepting Cake

                             Starting with the Database

                       MVC Default Behaviors

                       Naming Conventions

                             Naming Controllers

                             Naming Models

                             Naming Views

                             More Than One Word in the Name

                             Naming Other Cake Resources

                             Best Practices

                       Poorly Designed Databases

                             Why Good Database Design Matters

                             Feature Creep and Cake

                       Table Associations

                             The Database Design

                             "Belongs To"

                             "Has One"

                             "Has Many"

                             Testing the Associations

                             Conventions for Establishing Table Associations

                             "Has and Belongs to Many"

                       Beyond the Scaffold

                       Summary

CHAPTER 5 Creating Simple Views and Baking in the Console

                       Introducing Layouts

                             Writing the default.ctp File

                       Creating Individual Views

                             Adding Actions to the Controller

                       Using Bake to Create Views

                             Configuring the Console's Profile to Run Bake

                             Launching Bake

                             Using Bake to Generate CRUD Views

                       Editing Baked Views

                             Considering Internationalization

                       Using Commands for Faster Baking

                       Customizing Views

                       Summary

CHAPTER 6 Customizing Views

                       Handling User Interactions

                             A Simple Page Request

                             A Form Submission Sequence

                             Filling Form Fields for Editing or Updating

                             An Asynchronous Sequence

                       Writing Individual View Files

                             Using the Debug Function

                             Customizing the View File from Scratch

                             Customizing an HTML Form

                       Using Other Helpers

                       Summary

CHAPTER 7 Working with Controllers and Models

                       Building an Extensive Blog

                       Working with Actions

                             Using Variables in Actions

                             Requesting Actions

                             How Callback Actions Work in the Controller

                       Customizing the Controller for the Blog

                             Recursive

                             Pagination

                             The find() Function

                             Displaying the Most Recent Posts

                             The View Action

                             The read() Function

                             The setFlash() Function

                             The redirect() Function

                       Creating a Model for the Blog

                             The Add Action

                             The save() Function

                             Validating Data

                       Writing Custom Model Functions

                       Trimming Results

                             The unbindModel() Function

                             The bindModel() Function

                       Summary

CHAPTER 8 Implementing Ajax Features

                       How Ajax Works

                             Working with Ajax Frameworks

                             Using the Ajax Helper

                       Preparing the Ajax Helper

                             Installing Prototype

                             Including the JavaScript Helper in the App Controller File

                             Making Helpers Available for the Whole Application

                       Adding Comments to the Blog

                       Working Ajax into the View

                             Displaying Comments

                             Using an Ajax Form

                       Working Ajax into the Controller

                             Rendering for Ajax

                       Using Other Ajax Helper Functions

                             The submit() Function

                             The link() Function

                       Doing More with the Ajax Helper

                             Passing JavaScript with the Options Array

                             Prototype vs. jQuery

                       Uploading Files with jQuery

                             Installing jQuery and the Form Plugin

                             Creating the Posts Add Action

                             Creating the Posts Controller Text Action

                             Writing the Text View

                       More Ajax Features

                       Summary

PART 3     Advanced CakePHP

CHAPTER 9 Helpers

                       Installing Helpers

                       Using Cake's Built-in Helpers

                             Explain Every Helper Function?

                             Working with the HTML Helper

                             Using the HTML Helper in the Default Layout

                             Working with the Form Helper

                       Using Other Built-in Helpers

                             The Ajax Helper

                             The JavaScript Helper

                             The Number Helper

                             The Paginator Helper

                             The RSS Helper

                             The Session Helper

                             The Text Helper

                             The Time Helper

                             The XML Helper

                       Creating Custom Helpers

                             Using the App Helper

                             Creating the Helper File

                             Using Outside Helper Functions

                             Making a Helper for Your Blog

                       Customizing Helper Variables

                       Summary

CHAPTER 10 Routes

                       The Basic Route

                       Arguments

                       Reverse Routing

                             Lookups

                             Rewriting URLs in the Router

                       Admin Routing

                             Choosing an Admin Prefix

                             Linking Admin Actions and Views

                             Baking Admin Routes

                       Route Parameters

                             Magic Variables

                             Custom Expressions

                             The Pass Key

                       Parsing Files with Extensions Other Than .php

                             The Process

                             Creating the RSS Feed

                       Summary

CHAPTER 11 Components and Utilities

                       Why Use Components?

                             Using Components

                       Using Built-in Components

                             Authentication

                             Session

                             Cookie

                             Email

                             Other Components

                       Utility Classes

                             Configure

                             File and Folder

                             HTTP Socket

                             Localization and Internationalization

                             Sanitize

                       Third-Party Components

                       Creating Custom Components

                             Using the Initialize and Startup Functions

                             Writing Vendor Files Instead of Components

                       Summary

CHAPTER 12 Vendors

                       Using Vendors

                             Dealing with File Names

                             Dealing with Nested Folders

                       Making No Assumptions for Third-Party Scripts

                             Unidirectional Scripting

                       Installing a Third-Party Script

                             Including Textile

                             Instantiating and Running Textile

                             Writing Posts with Textile

                       Using Other Frameworks with CakePHP

                             Zend Framework

                       Summary

CHAPTER 13 Plugins

                       Installing a Third-Party Plugin

                       Creating Custom Plugins

                             Naming Convention for Plugin Elements

                             Running Plugin Actions

                             Using Plugin Layouts

                       The Calendar Plugin

                             Setting Up the Files and Folders

                             Create the Events Table

                             Create the Event Model

                             Create the Events Controller

                       Summary

CHAPTER 14 DataSources and Behaviors

                       Extending the Model with DataSources and Behaviors

                       Working with DataSources

                             Using Built-in DataSources

                             Building a Custom DataSource

                       Working with Behaviors

                             Using the Tree Behavior to Categorize Blog Posts

                             Using Other Tree Behavior Functions

                             Using the ACL and Translate Behaviors

                             Using the Containable Behavior

                             Attaching and Detaching Behaviors

                             Writing Custom Behaviors

                       Summary

CHAPTER 15 Wrapping Up the Application

                       Designing the Home Page

                             Using the Pages Controller to Produce a Single View

                             Making an Action the Starting Point

                       Generating Dynamic Navigation

                       Customizing the Overall Design

                       Debugging the Application

                       Running the Application on a Remote Host

                       Summary

PART 4     Appendixes

APPENDIX A Installation Issues

                       Developing in a Localhost Environment

                             Using the Localhost First, Remote Last

                             Why Doing It All Remotely Is Bad

                       Setting Up a Localhost

                             Setting Up on a Mac

                             Setting Up on Windows

                       Running MySQL

                             Where to Find Other MySQL Tools

                             Typical Settings When Running MySQL

APPENDIX B How CakePHP Compares with Other Frameworks

                       PHP Frameworks

                       Using the Various Frameworks

                             CakePHP

                             CodeIgniter

                             Symfony

                             Zend Framework

INDEX

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.128.57