Agile Web Application Development with Yii1.1 and PHP5
eBook - ePub

Agile Web Application Development with Yii1.1 and PHP5

  1. 368 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Agile Web Application Development with Yii1.1 and PHP5

Book details
Book preview
Table of contents
Citations

About This Book

In Detail

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

Approach

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".

Who this book is for

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.

Frequently asked questions

Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes, you can access Agile Web Application Development with Yii1.1 and PHP5 by Jeffrey Winesett in PDF and/or ePUB format, as well as other popular books in Computer Science & Programming in PHP. We have over one million books available in our catalogue for you to explore.

Information

Year
2010
ISBN
9781847199584
Edition
1

Agile Web Application Development with Yii 1.1 and PHP5


Table of Contents

Agile Web Application Development with Yii 1.1 and PHP5
Credits
About the Author
About the Reviewers
Preface
What this book cover
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Errata
Piracy
Questions
1. Meet Yii
Yii is easy
Yii is efficient
Yii is extensible
MVC architecture
The model
The view
The controller
Stitching these together: Yii request routing
Blog posting example
Object-relational mapping and Active Record
Active Record
The view and controller
Summary
2. Getting Started
Installing Yii
Installing a database
Creating a new application
Hello, World!
Creating the controller
One final step
Reviewing our request routing
Adding dynamic content
Adding the date and time
Adding the date and time, a better approach
Moving the data creation to the controller
Have you been paying attention?
Linking pages together
Linking to a new page
Getting a little help from Yii CHtml
Summary
3. The TrackStar Application
Introducing TrackStar
Creating user stories
Users
Projects
Issues
Navigation and page flow
Defining a data scheme
Defining our development methodology
Automated software testing
Unit and functional testing
Unit tests
Functional tests
Benefits of testing
Test-driven development
Testing in Yii
Unit tests
Installing PHPUnit
Functional tests
Installing Selenium
Running a quick example
Hello TDD!
Summary
4. Iteration 1: Creating the Initial TrackStar Application
Iteration planning
Creating the new application
Connecting to the database
Testing the connection
Yii and databases
Adding a db connection as an application component
Summary
5. Iteration 2: Project CRUD
Iteration planning
Running our test suite
Creating the project table
Naming conventions
Creating the AR model class
Configuring Gii
Using Gii to create our Project AR class
Testing out our newly generated code
Creating the unit test file
Testing create
Testing read
Testing update and delete
Was all that testing really necessary?
Enabling CRUD operations for users
Creating CRUD scaffolding for projects
Creating a new project
Adding a required field to our form
Reading the project
Updating and deleting projects
Managing projects in admin mode
More on testing—fixtures
Configuring the fixture manager
Creating a fixture
Configuring this fixture for use
Specifying a test database
Using fixtures
Summary
6. Iteration 3: Adding Tasks
Iteration planning
Running the test suite
Designing the schema
Defining some relationships
Building the database and the relationships
Creating the Active Record model classes
Creating the Issue model class
Creating the User model class
Creating the Issue CRUD operations
Using the Issue CRUD operations
Creating a new Issue
Adding the types drop-down menu
Getting the test in the "Red"
Moving From "Red" To "Green"
Moving Back To "Red"
Getting back to "Green" once again
Adding the issue type dropdown
Adding the status drop-down menu: Do it yourself
Fixing the owner and requester fields
Enforcing a project context
Implementing a filter
Adding a filter
Specifying the filtered actions
Adding some filter logic
Adding the project ID
Altering the project details page
Removing the project input form field
Returning back to the owner and requester dropdowns
Generating the data to populate the drop-down menu
Adding User and ProjectUserAssignment fixtures
Making one last change
Finishing the rest of the CRUD
Listing the issues
Altering the ProjectController
Altering the project view file
Making some final tweaks
Getting the status and type text to display
Adding the text display to the form
Changing the issue detail view
Getting the owner and requester names to display
Using relational AR
Making some final navigation tweaks
Summary
7. Iteration 4: User Management and Authentication
Iteration planning
Running the test suite
Creating our User CRUD
Updating our common audit history columns
Adding a password confirmation field
Adding password encryption
Authenticating users using the database
Introducing the Yii authentication model
Changing the authenticate implementation
Extending application user attributes
Updating the user last login time
Displaying the last login time on the home page
Summary
8. Iteration 5: User Access Control
Iteration planning
Running our existing test suite
accessControl filter
Role-based access control
Configuring the authorization manager
Creating the RBAC database tables
Creating the RBAC authorization hierarchy
Writing a console application command
Assigning users to roles
Adding RBAC roles to projects
Adding RBAC business rules
Implementing the new Project AR methods
Adding Users To Projects
Altering the Project model class
Adding the new form model class
Adding the new action method to the project controller
Adding the new view file to display the form
Putting it all together
Checking authorization level
Summary
9. Iteration 6: Adding User Comments
Iteration planning
Creating the model
Creating the Comment CRUD
Altering the scaffolding to meet requirements
Adding a comment
Displaying the form
Creating a recent comments widget
Introducing CWidget
More on relational AR queries in Yii
Completing the test
Creating the widget
Introducing CPortlet
Adding our widget to another page
Summary
10. Iteration 7: Adding an RSS Web Feed
Iteration planning
A little background: Content Syndication, RSS, and Zend Framework
Installing Zend Framework
Using Zend_Feed
Creating user friendly URLs
Using the URL manager
Configuring routing rules
Removing the entry script from the URL
Adding the feed links
Summary
11. Iteration 8: Making it Pretty - Design, Layout, Themes, and Internationalization(i18n)
Iteration planning
Designing with layouts
Specifying a layout
Applying and using a layout
Deconstructing the main.php layout file
Introducing the Blueprint CSS framework
Understanding the Blueprint installation
Setting the page title
Defining a page header
Displaying menu navigation items
Creating a breadcrumb navigation
Specifying the content being decorated by the layout
Defining the footer
Nesting the layouts
Creating themes
Building themes in Yii
Creating a Yii theme
Configuring the application to use a theme
Translating the site to other languages
Defining locale and language
Performing language translation
Performing message translation
Performing file translation
Summary
12. Iteration 9: Modules - Adding Administration
Iteration planning
Modules
Creating a module
Using a module
Theming a module
Applying a theme
Restricting admin access
Adding a system-wide message
Creating the database table
Creating our model and CRUD scaffolding
Adding a link to our new functionality
Displaying the message to users
Importing the new model class for application-wide access
Select...

Table of contents

  1. Agile Web Application Development with Yii 1.1 and PHP5