PacktLib: Kohana 3.0 Beginner’s Guide

Kohana 3.0 Beginner's Guide

Credits

About the Author

About the Reviewers

www.PacktPub.com

Preface

Getting Started

System requirements

Case Study

Downloading and installing from the Web

Time for action – Downloading from web

Installing Kohana from GitHub

Time for action – downloading using Git

Testing the environment

Configuring Kohana for Development Environment

Time for action – Setting your Timezone

Time for action – setting base URL

Time for action – Setting Kohana::$environment

Time for action – Enabling the User Guide

Testing your configuration

Summary

Using Views and Controllers

What are controllers and views?

Updating our Welcome Controller

Time for action – Getting our controller action to use a view file

Passing data to the view

Time for action – Passing data via the factory method

Time for action – Passing data as view variables

Time for action – Passing data using the set() method

Time for action – Passing data using the bind( ) method

Time for action – Passing data using multiple methods

Using the Template Controller

Time for action – Extending Kohana's Template Controller

Time for action – Setting global view variables

Time for action – Binding global view variables

Creating new controllers

Time for action – Creating our first controller

Time for action – Expanding on our first controller

Creating a base controller

Time for action – Creating an abstract controller

Putting it all together

Time for action – Adding stylesheets to template

Time for action – Adding header and footer view files

Summary

Routing and Request Handling

Hierarchy is King in Kohana

Request flow in Kohana

Using the Request object

Time for action – Creating a profile page with messages

Time for action – Creating a request within a request

Routing in Kohana

Time for action – Making profiles dynamic using ID

Time for action – Creating a Custom Route

Time for action – Adding regex to a route

Time for action – Allowing additional segments in a route

Time for action – Using Subdirectories and Routes

Summary

Working with Helpers and Classes

Autoloading classes

Introducing helpers

Time for action – Creating configuration for Encryption

Time for action – Creating a login form using the Form helper class

Time for action – Creating a signup form for new users

Extending Helpers

Time for action – Extending the HTML helper method

Summary

Installing and Configuring Modules

Anatomy of a Module

Loading and configuring modules

Bundled modules

Time for action – Configuring your application to use a database

Time for action – Creating a database table and using the query builder

Time for action – Adding pagination to database results

Installing modules

Time for action – Installing a module from an archive

Time for action – Installing a module using git

Creating your own modules

Summary

Interacting with the Database

Anatomy of a model

Using the Database module

Time for action – Refactoring Model_Message to allow dynamic search

Time for action – Adding the ability to insert messages in case study site

Time for action – Add ability to edit messages in case study site

Time for action – Add ability to delete messages from the case study site

Using the Database Module with sessions

Time for action – Adding session handling with the database adapter

Summary

Using the ORM and Auth Modules

Using the ORM module

Time for action – Updating Message Model to use ORM

Time for action – Adding validation to Message Model

Using the Auth module

Time for action – Adding users and Auth to case study site

Time for action – Adding the Auth functionality to the case study site

Time for action – Adding secure actions to the case study site

Summary

Troubleshooting and Error Handling

Debugging code with Kohana

Time for action – Adding error messages to signup form

Handling 404 redirects

Time for action – Adding a custom 404 page

Profiling our applications

Time for action – Adding profiling to the case study project

Summary

Securing and Deploying Kohana 3

Securing our applications

Time for action – Securing against XSS risks

Preparing for production

Summary

Upgrading from CodeIgniter and Kohana 2

Upgrading from CodeIgniter and Kohana 2

Upgrading from CodeIgniter and Kohana 2

Upgrading from CodeIgniter and Kohana 2

Upgrading from CodeIgniter and Kohana 2

Index