Web Application Development with Yii and PHP
For PHP programmers with a yearning to add modernity and sophistication to their web applications, this book will be a revelation. A step-by-step tutorial to Yii, it talks you through the development of a complete real-world application.
- A step-by-step guide to creating a modern Web application using PHP, MySQL, and Yii
- Build a real-world, user-based, database-driven project task management application using the Yii development framework.
- Start with a general idea, and finish with deploying to production, learning everything about Yii inbetween, from "A"ctive record to "Z"ii component library.
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.
What you will learn from this book
- Auto-generate skeleton web applications as well as CRUD scaffolding for the domain object model using the built-in command-line interface
- Use Yii database migrations to version and manage your database changes
- 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 manage the user's last login time and store it in the database
his early ages. After toying around with a plethora of programming languages and operating systems, Stephan has now settled mostly for Fedora Linux and web programming with PHP (for the time being). He is currently involved in making the Yii framework better and creating formidable applications with it. Alexander Makarov is an experienced engineer from Russia, and a member of the Yii framework core team since 2010. He is the author of another book on the Yii framework called Yii 1.1 Application
if curious, you can take a look at the protected/views/layouts/ directory to see the layout files that have been defined and to help shine a little light on where the rest of the HTML is defined. Reviewing our request routing Let's review how Yii analyzes our request within the context of this example application: 1. Navigate to the "Hello, World!" page by pointing your browser at the URL http://localhost/helloworld/index.php?r=message (or you can use the equivalent URL
locale and language Performing language translation 231 231 233 235 236 237 237 240 240 240 242 244 244 245 Summary 250 Performing message translation Performing file translation Chapter 11: Using Yii Modules 246 249 251 Feature planning Working with modules Creating a module Using a module Module layout 252 252 252 255 256 [v] Table of Contents Applying a layout 258 Restricting admin access Adding a system-wide message Creating the database table Creating our model
project. That is, a specific project should be chosen before you are able to create a new issue. Currently, our application does not enforce this workflow. Let's address these changes one by one. First, we will alter the application to enforce a valid project to be identified prior to using any functionality to manage the issues associated with that project. Once a project is chosen, we'll make sure that both our owner and requester drop-down choices are restricted to only the users that are
you to customize all of its defaults and makes it easy to override all of these conventions. We will be covering some of these defaults and conventions later in this chapter and throughout the book. Efficient Yii is a high-performance, component-based framework that can be used for developing web applications on any scale. It encourages maximum code reuse in web programming and can significantly accelerate the development process. As mentioned previously, if you stick with Yii's built-in