Kohana 3.0 Beginner’s Guide

Develop professional web applications with Kohana.

Kohana 3.0 Beginner’s Guide

Beginner's Guide
Jason D. Straughan

Develop professional web applications with Kohana.
$26.99
$44.99
RRP $26.99
RRP $44.99
eBook
Print + eBook
$12.99 p/month

Want this title & more? Subscribe to PacktLib

Enjoy full and instant access to over 2000 books and videos – you’ll find everything you need to stay ahead of the curve and make sure you can always get the job done.
+ Collection
Free sample

Book Details

ISBN 139781849512404
Paperback344 pages

About This Book

  • The first and only book on the Kohana 3 PHP framework.
  • Covers all major areas needed to begin developing web applications with Kohana
  • Covers complete development cycle from installation to deployment
  • Easy to follow instructions that help you build a working example application during the course of the book

Who This Book Is For

If you are a web developer who wants to create web applications using the Kohana 3 framework, then this book is for you. The book assumes that you have some experience with PHP and Object- Oriented Programming (OOP).

Table of Contents

Chapter 1: 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
Chapter 2: 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
Chapter 3: 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
Chapter 4: 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
Chapter 5: 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
Chapter 6: 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
Chapter 7: 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
Chapter 8: 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
Chapter 9: Securing and Deploying Kohana 3
Securing our applications
Time for action – Securing against XSS risks
Preparing for production
Summary

What You Will Learn

  • Understand the HMVC architecture
  • Learn Routing and Requesting handling in Kohana
  • Create modules for extending your applications
  • Interact with the Database and ORM classes to provide an object- oriented way of manipulating data
  • Create helper classes to make your code fast to write and easy to use.
  • Troubleshoot and debug your Kohana application
  • Implement security and deployment best practices
  • Migrate from Kohana 2.x or CodeIgniter

In Detail

Modern web development relies heavily on the ability to rapidly create applications that are reliable, maintainable, and scalable. The PHP-based Kohana framework has proven to be one of the best platforms for delivering professional quality applications using a stable framework that allows you to build great web properties while leveraging a rapid development architecture that is both powerful and intuitive.

Kohana 3 Beginner’s Guide is the first and only book in the market for learning about this popular and powerful open-source PHP framework. Written with the beginner in mind, this book walks you through installation and configuration, then uses a case study site to deliver real world solutions to common web development needs.

Beginning with the installation and configuration of the framework, you are guided through the steps necessary to get up and running, and are quickly introduced to the basics of Kohana.

Using a case study site as an example, the book illustrates core components of Kohana while showing elegant solutions to real world tasks developers face every day. From working with forms to databases, interacting with users to deploying applications in the wild, everything is covered in simple, easy to understand examples.
By the end of this book you will have mastered the core tasks needed to build great web applications using

Authors

Table of Contents

Chapter 1: 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
Chapter 2: 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
Chapter 3: 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
Chapter 4: 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
Chapter 5: 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
Chapter 6: 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
Chapter 7: 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
Chapter 8: 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
Chapter 9: Securing and Deploying Kohana 3
Securing our applications
Time for action – Securing against XSS risks
Preparing for production
Summary

Book Details

ISBN 139781849512404
Paperback344 pages
Read More