You are previewing Instant CakePHP Starter.
O'Reilly logo
Instant CakePHP Starter

Book Description

Learn everything you need to develop a feature-rich CakePHP app, from installation to deployment

  • Learn something new in an Instant! A short, fast, focused guide delivering immediate results.

  • Focus on an iterative practical approach to learn the myriad features of CakePHP

  • Learn about Models, Views, and Controllers as well as scaffolding, themes, behaviors, and routing

  • Scaffold and generate your application code using the command-line “bake” tool almost exclusively

In Detail

CakePHP is an exciting tool focused on writing web applications in PHP in a simple and fast way that requires less code. You can rapidly build prototypes using code generation and scaffolding. It doesn't require any complicated XML or YAML files. You just need to set up your database and you're ready to bake!

Instant CakePHP Starter contains several tutorials that together build a powerful and engaging application, and in the process teaches you many features of CakePHP, both common and obscure. It is not simply a listing and explanation of features you could get from reading the online documentation. This book is an exploration of the experience of installing, building, and deploying a CakePHP application in a step by step way.

This book begins by installing CakePHP locally, and then deploying your application to production.

We move on by scaffolding our application using the wonderful command-line tool that is packaged with CakePHP, bake. With our code generated for us, we install a theme to instantly update the look of the app, iterating over it a few times to add URLs, an installable JavaScript component, and a JSON service.

We conclude with a discussion of the community. In short, Instant CakePHP Starter is a kick start to your experience with both CakePHP and its community.

Table of Contents

  1. Instant CakePHP Starter
    1. Instant CakePHP Starter
    2. Credits
    3. About the author
    4. About the reviewers
    5. www.packtpub.com
      1. Support files, eBooks, discount offers, and more
    6. www.packtLib.packtPub.com
      1. Why Subscribe?
      2. Free Access for Packt Publishing account holders
    7. 1. Instant CakePHP Starter
      1. So, what is CakePHP?
        1. CakePHP – the short story
        2. Why CakePHP – making the short story long
        3. CakePHP to the rescue!
        4. Model-View-Controller – what is that all about?
      2. Installation
        1. Step 1 – preparing the development environment
          1. The HTTP server (Apache)
          2. The database layer (MySQL)
          3. PHP
          4. Source control
        2. Step 2 – getting and installing the CakePHP application
          1. Base install
          2. Cleaning up the errors on the home page
        3. Step 3 – setting up the production deployment
          1. Binding your MySQL database to your application
          2. Changing the file for deployment
          3. Downloading the af command-line tool
          4. Pushing your code
        4. And that's it
      3. Quickstart – building a web application
        1. Step 1 – architecture
          1. The models
          2. The controllers
          3. The views
        2. Step 2 – scaffolding with the command-line tool
          1. Creating the schema definition
          2. Creating the database schema
          3. Creating the models
          4. Creating the controllers
          5. Creating the views
        3. Step 3 – taking a look at our scaffolded app
        4. Step 4 – what else does "bake" do for us?
          1. API documentation
          2. Internationalization, or i18n
          3. Generating .pot files
        5. Step 5 – deploying to production
          1. Pushing the code
          2. Updating the database
        6. Step 6 – congratulations!
      4. Top 6 features you'll want to know about
        1. What do we know at this point?
        2. Routing – naming matters!
          1. A bit more detail
        3. Views and themes
          1. Views summary
          2. Views – a quick overview
          3. Installing the Cakestarter-Bootstrap theme
        4. Better URLs
          1. Altering the schema
          2. Installing the sluggable behavior
          3. Making your controllers aware of the slugs
          4. Updating the views
        5. Adding the Install page
          1. Using the built-in PagesController
        6. Creating a JSON service for the JavaScript to consume
        7. Fixtures and automated tests
          1. What is automated testing?
          2. The initial setup
            1. Installing PHPUnit
            2. Creating your test database
            3. On to the good stuff!
      5. People and places you should get to know
        1. The Bakery
        2. Getting support from the community
          1. IRC (Internet Relay Chat) channels
          2. The Google group, Google Plus page, and CakePHP questions
        3. CakePHP on social media
          1. Twitter
          2. Facebook
        4. Conventions and meetups
          1. CakeFest
          2. Meetups
        5. Parting words