Agile Web Application Development with Yii1.1 and PHP5
Formats:
save 15%!
save 37%!
Anytime, Anywhere
Free Shipping!
| Also available on: |
|
- A step-by-step guide to creating a modern, sophisticated web application using an incremental and iterative approach to software development
- Build a real-world, user-based, database-driven project task management application using the Yii development framework
- Take a test-driven design (TDD) approach to software development utilizing the Yii testing framework
- Write less code by using Yii's application generation and scaffolding tools
- Enhance your application by adding Web feeds, adapting it to multiple languages, and by utilizing themes to provide beautiful skins and design flexibility
Book Details
Language : EnglishPaperback : 368 pages [ 235mm x 191mm ]
Release Date : August 2010
ISBN : 1847199585
ISBN 13 : 9781847199584
Author(s) : Jeffrey Winesett
Topics and Technologies : All Books, Open Source, Web Development
Table of Contents
Preface
Chapter 1: Meet Yii
Chapter 2: Getting Started
Chapter 3: The TrackStar Application
Chapter 4: Iteration 1: Creating the Initial TrackStar Application
Chapter 5: Iteration 2: Project CRUD
Chapter 6: Iteration 3: Adding Tasks
Chapter 7: Iteration 4: User Management and Authentication
Chapter 8: Iteration 5: User Access Control
Chapter 9: Iteration 6: Adding User Comments
Chapter 10: Iteration 7: Adding an RSS Web Feed
Chapter 11: Iteration 8: Making it Pretty - Design, Layout, Themes, and Internationalization(i18n)
Chapter 12: Iteration 9: Modules - Adding Administration
Chapter 13: Iteration 10: Production Readiness
Index
Jeffrey Winesett
Code Downloads
Download the code and support files for this book.
Submit Errata
Please let us know if you have found any errors not listed on this list by completing our errata submission form. Our editors will check them and add them to this list. Thank you.
Errata
- 21 submitted: last submission 18 Apr 2013Errata type: Code| Page number: 190
sql query line "primary key (projectId,userId,role)," throws an error "Key column 'projectId' doesn't exist in table". the line should say "primary key (project_id,user_id,role),"
Errata type: Code| Page number: 105
The public function testGetTypes should be in a class. Before: public function testGetTypes() { $options = Issue::model()->typeOptions; $this->assertTrue(is_array($options)); } Solution: class IssueTest extends CDbTestCase { public function testGetTypes() { $options = Issue::model()->typeOptions; $this->assertTrue(is_array($options)); } } "
Errata type: Code| Page number: 193
function "associateUserToRole" returns "$command->execute" but it should be "$command->execute()"
Errata type: Language| Page number: Preface
The first section title reads: "What this book cover" it should read: "What this book covers" or "What is covered in this book"
Errata type: code| Page number: 20
"Your application has been created successfully under /Webroot/demo/" should still be in Packt console command code format, as it is still part of the output from running the shell command.
Errata type: language | Page number: Preface, page 3
Under the Conventions section, it is describing how code words in the text are shown and it uses the sentence: "You can type in help to see a list of commands available to you within his shell" It should be "...this shell" NOT "...his shell" (i.e. 'his' should be 'this')
Errata type: Language | Page number: 142
The very beginning sentence on this page has several issues. The sentence as it is printed is impossible to understand. The entire sentence should read: "As these links originate from the issue details page, we can take advantage of the associated project, and alter the links to pass in the specific project id. We can then use that project id as the criteria to limit the Issues returned by the query in both the IssueController::actionIndex, and IssueController::actionAdmin() methods."
Errata type: Language | Page number: 142
there is a word that is printed as "conssue", it should be "context": "...implemented a filter to enforce a valid project context"
Errata type: Code | Page numbers: 96-97
When trying to execute the SQL to create the relationships (on page 97), MySQL gives an error #1005: #1005 - Can't create table 'trackstar_dev.#sql-1a4_9d' (errno: 121) (<a href="server_engines.php?engine=InnoDB&page=Status&token=fdfsdghrw222323hndgsf">Details...</a>)
The solution is to rename the fields in the join table (tbl_project_user_assignment) to something like proj_id and req_id and update the relationship commands accordingly.
Errata type: Typo| Page numbers: 109
The sentence:
This line is using the CActiveForm::labelEx() method to render an HTML label for a the Issue model attribute, type_id.
Should read:
This line is using the CActiveForm::labelEx() method to render an HTML label for the Issue model attribute, type_id.
Note: There was an extra "a" after the word "for".
Errata type: Typo | Page numbers: 142
The sentence:
"As these links originate from the Issue details page, and that specific issue has an associated project, we can first alter the links to pass in a specific project ID, and thehe uof that project ID as both"
Should read:
"As these links originate from the Issue details page, and that specific issue has an associated project, we can first alter the links to pass in a specific project ID, and then use that project ID in both"
Errata type: Typo | Page number: 75 | Errata date: 14 September 11
"We can see that quite a few files are going to be generated, which include a new ProjectContrller.php" last word misses an "o".
It should read as "We can see that quite a few files are going to be generated, which include a new ProjectController.php".
ERRATA:
Errata type: Typo | Page number: 96
In the diagram the last line of text states: '0 or Nore'. This must be '0 or More'
Errata type: Others | Page number: 116
With this in place, now attempt to create a new issue by clicking the Create Issue link from the issue listing page at this URL, http://hostname/tasctrak/index.php?r=issue/list
Should be:
With this in place, now attempt to create a new issue by clicking the Create Issue link from the issue listing page at this URL, http://localhost/trackstar/index.php?r=issue/list
Errata type: Others | Page number: 163 & 164 | Errata date: 09 Sep 2011
Page 163 says UserIdentity::authenticate() is called and page 164 a new UserIdentity() object is created within UserIdentity::authenticate() method.
The "UserIdentity" class on page 163 should be named another name. The actual UserIdentity class should be the one defined on page 161.
Errata type: Typo | Page number: 210 | Errata date: 11 Nov 2012
Page 210, 3rd paragraph, last line says,
The following line was added to the project show.php view file's list of link options.
This line should be,
The following line was added to the project view.php view file's list of link options
Errata type: Typo | Page number: 142 | Errata date: 18 Dec 2012
We already knew we had to make this change for the Create link, as we have previously implemented a filter to enforce a valid project conssue.
Should be
We already knew we had to make this change for the create link, since we have previously implemented a filter to enforce a valid project context be made available prior to creating a new issue.
Errata type: Typo | Page number: 142 | Errata date: 18 Dec 2012
As these links originate from the Issue details page, and that specific issue has an associated project, we can first alter the links to pass in a specific project ID, and thehe uof that project ID as both the IssueController::actionIndex, and IssueController::actionAdmin() methods.
Should be:
As these links originate from the Issue details page, and that specific issue has an associated project, we can first alter the links to pass in a specific project ID, and then limit the use of that project ID as both the IssueController::actionIndex, and IssueController::actionAdmin() methods.
For queries in the first four chapter of this book, kindly refer the following link:
http://www.yiiframework.com/forum/index.php/topic/38495-some-problem-with-the-book-first-4-chapter/
Errata type: code | Page number: 129
The line in the code that says:
'params'=>array(':projectId'=>$this->loadModel()->id),
Should say: 'params'=>array(':projectId'=>$this->loadModel($id)->id),
The loadModel method needs to be passed the project id.
This is the first edition of the book.
In this case, this is not an error. The code in the book IS correct for the OLDER version of Yii used in the book 1.1.2. For later versions of Yii, the code would need to be changed per the readers remarks.
The sql file with the finished database can be found at the following link:
https://github.com/jeffwinesett/yiibook-trackstar-code/tree/master/trackstar/protected/data
Errata type: Code | Page No.: 294
Adding $this->layout = 'main' to init() method doesn't work. Please reference this page:
http://www.yiiframework.com/forum/index.php/topic/12763-chapter-12-admin-module-automatically-uses-the-site-theme/
It solves this problem by moving layout setting to beforeControllerAction method and then it works.
Sample chapters
You can view our sample chapters and prefaces of this title on PacktLib or download sample chapters in PDF format.
- Take a "test first" approach to software development using the Yii testing framework
- Auto-generate skeleton web applications as well as CRUD scaffolding for the domain object model using the built-in command-line interface
- Create user-based applications with Yii's authentication model
- Enhance your user-based application to control a user's access to feature functionality
- Write an administrative console application to extend the features provided by Yii's powerful command-line tools
- Integrate other frameworks and libraries into a Yii application to further extend its feature set
- Spend less time managing application configuration by taking advantage of Yii's sensible defaults and conventions.
- Learn how easy it is to implement a multi-user application by utilizing Yii's authentication and role-based authorization models
- Update your code to properly mange the user's last login time and store it in the database
- Achieve pre- and post-action method request processing using controller filters
- Tap into the CActiveRecord validation workflow to allow for pre- and post-validation processing of your model data
- Greatly increase re-use, consistency, and ease of maintenance of the application by developing small content blocks called portlets
- Make your application accessible to the world with internationalization (l18N) features and enhance the looks of your application using the Yii theming model
This book is a step by step tutorial in developing a real-world application using the incremental and iterative approach to software development. You learn about agile software development by leaning on the agile nature of the Yii application development framework. You touch on each aspect of the software development lifecycle by building a project task management application from concept through production deployment.
After a brief, general introduction to the Yii framework and outlining the software development approach taken throughout the book, the chapters break down in the same way as software development iterations do in real-world projects. After the 1st iteration, you will have a working and tested application with a valid, tested connection to a database.
In the 2nd and 3rd iterations, we flesh out our main database entities and domain object model and become familiar with Yii's object-relational-mapping (ORM) layer, Active Record. We also learn how to lean on Yii's auto-generation tools to automatically build our create/read/update/delete (CRUD) functionality against our newly created model. These iterations also focus on how Yii's form validation and submission model works. By the end of the third iteration you will have a working application that allows you to mange projects and issues (tasks) within those projects.
The 4th and 5th iterations are dedicated to user management. We learn about the built-in authentication model within Yii to assist in application login and logout functionality. We then dive into the authorization model, first taking advantage of a Yii's simple access control model, then implementing the more sophisticated role-based access control (RBAC) framework that Yii provides.
By the end of the 5th iteration, all of the basics of a task management application are in place. The next several iterations are focused on the nice-to-haves. We add user comment functionality, introducing a reusable content portlet architecture approach in the process. We add in an RSS Web feed and demonstrate how easy it is to integrate other third-party tools within a Yii application. We take advantage of Yii's theming structure to help streamline and design the application, and then introduce Yii's internationalization (I18N) features so the application can be adapted to various languages and regions without engineering changes.
Finally, we turn our focus to production deployment. We introduce ways to optimize performance and security to prepare the application for a real-world production environment.
Learn the Yii development framework by taking a test-driven, incremental, and iterative approach to building a real-world task management application
This is a step-by-step tutorial for developing web applications using Yii. This book follows the test-first, incremental, and iterative approach to software development while developing a project task management application called "TrackStar".
If you are a PHP programmer with knowledge of object oriented programming and want to rapidly develop modern, sophisticated web applications, then this book is for you. No prior knowledge of Yii is required to read this book.

