Beginning Yii

Fast track your web application development by harnessing the power of the Yii PHP framework
3.5 (8 ratings)
Instead of using a simple lifetime average, Udemy calculates a
course's star rating by considering a number of different factors
such as the number of ratings, the age of ratings, and the
likelihood of fraudulent ratings.
128 students enrolled
Take This Course
  • Lectures 41
  • Length 2.5 hours
  • Skill Level All Levels
  • Languages English
  • Includes Lifetime access
    30 day money back guarantee!
    Available on iOS and Android
    Certificate of Completion
Wishlisted Wishlist

How taking a course works


Find online courses made by experts from around the world.


Take your courses with you and learn anywhere, anytime.


Learn and practice real-world skills and achieve your goals.

About This Course

Published 9/2014 English

Course Description

Starting with the basics of installing and configuring Yii, you will learn how to use the Yii application generator to build your first fully working application with just one command. You will then move on to a step-by-step progression to tailoring this to your requirements by including database access methods and manipulating queries as well as using sub-forms and third-party plugins. This course also covers how to use the fully integrated auto-testing tools such as PHPUnit and Selenium, uploading and crunching images, using themes, user security and authentication, debugging and logging, and finally how to configure your application for deployment.

By the end of Beginning Yii, you will be fully conversant with the Yii framework, and you will be able to confidently build applications.

About the Author

Chris Backhouse is an independent web developer with 30 years of experience in Software Development. Over the past 3 years, he has specialized in optimising businesses by building customized web applications based on LAMP technologies and PHP frameworks such as Yii. He has been using web platforms for more than 10 years.

Previously, Chris provided independent consultancy to international businesses around Europe. His particular expertise lay in the management of introducing advanced technologies into the system development work place and the creation and maintenance of the processes involved. Companies such as Cisco Inc, Hyder plc, and Microsoft UK have benefited in these areas.

What are the requirements?

  • Beginning Yii is a step-by-step tutorial for developing web applications using Yii. This video course follows the iterative approach to software development while developing a photo gallery website.

What am I going to get from this course?

  • Beginning Yii is a step-by-step tutorial for developing web applications using Yii. This video course follows the iterative approach to software development while developing a photo gallery website.

Who is the target audience?

  • If you are a PHP developer, either with or without previous framework experience, and you have an interest to learn Yii and to rapidly develop modern, sophisticated web applications, then this course is for you. No prior knowledge of Yii is expected.

What you get with this course?

Not for you? No problem.
30 day money back guarantee.

Forever yours.
Lifetime access.

Learn on the go.
Desktop, iOS and Android.

Get rewarded.
Certificate of completion.


Section 1: Exploring Yii

In this video, you’ll be introduced to the topics that will be covered in the course.


Understand how a Framework is an architectural collection of tools


MVC architecture is important because it produces a structured and an easily maintainable code.


To better understand the flow of information and which component is responsible for what, we’ll take a look at the MVC request routing.


What makes Yii so popular?

Section 2: Getting Started with Yii

You will need to have these items installed and running before you can start development. Ensuring that your versions are current and up to date will mean that you are less likely to have incompatibility problems. You must be running PHP 5.3 or later.


Using Yii to generate the web application builds the skeleton disrectory structure and adds the necessary bootstrap and configuration files. This makes it much quicker and easier to start development.


Understanding the Yii configuration file and the flexibility it can provide will make both development and deployment of your application much easier.


By developing an application such as this, we will be able to meet a broad spectrum of everyday issues, such as specialised validation, url management and image manipulation. We will also see how we can add functionality in layers taking the development from prototype to full application.


The code generated by Gii will account for a large percentage of your final code base, thus saving you both time and money in the development lifecycle.

Section 3: Starting Development (Using Our IDE)

The CActiveRecord object is Yii's encapsulation of database manipulation, and it provides extensive functions to simplify database queries and updates.


The Yii CHtml object provides a rich functionality for generating complex HTML and JavaScript. We will see how to quickly adapt to the autogenerated forms.


Integrating server-side and client-side apps can often be complex and messy. We will see how third-party Yii extensions can easily be integrated with our application.


In this video, we'll look into adding new columns to the album's data model class, specifying new validation rules and removing unwanted search terms.


Understanding the controller processing in a create and update scenario helps you change the create and update forms and manage model validation.


Learn how to embed an existing form from one model as a subform in another model by understanding how to query and display data from other models.

Section 4: Testing

Testing often gets left or forgotten.Understand the benefits of implementing automated testing tools whatever the scale of your development.


We will demonstrate how quick and easy it is to set up a testing environment.


Learn how to produce and run PHPUnit scripts and analyze the results.


Learn how to automate the action of ensuring that you are always testing with the same data.


Automating the functional tests will quickly enable you to retest pages across your application with minimal effort.

Section 5: The Photo Application

Extensions can save a huge amount of development effort, so familiarity with the extensions library is beneficial.


How to include third-party widgets and customize them to our needs.


Learn how to process Ajax requests and manage image/binary files using the cUploadedFile class.


Understanding this powerful tool can simplify your form development.


Customize the actions available for each row to increase the flexibility of this widget.

Section 6: Themes, Layout and User Access

We will learn how theme files override application files, and also how the hierarchy of the views are displayed.


We will see how we can alter the available navigation items for authenticated and guest users.


We will show how the login process manages the relationship between the user authentication and the web user session, and how to customise this process.


We will learn how we can quickly and easily tailor the web user class for our applications.


We will learn how controller implements access rules, and how we can adapt these to suit our needs. We will also see how we can apply restrictions across multiple access rules using user-defined filters.

Section 7: Debugging, Logging and Error Handling in Yii

There are occasions when we need to step through our code line by line to find that illusive bug or to trace the value of a variable, and xDebug is the tool for this job.


Using log routes will enable us to divert the output to different files for different log levels and categories.


SQL debugging and profiling enable us to more accurately analyze and pinpoint bottlenecks and produce more efficient SQL and code.


Learn to use a tool that will be indispensable in debugging your code.


Understand how to use error handling to hide system specifics from users and hackers.

Section 8: Customizing Our Album Interface

Understand how using a cross-model functionality demonstrates how an MVC architecture holds the business rules at the model level.


We store the tags in a single text field using a comma delimited approach, so we need to present this to users in an understandable and easy-to-use manner. To this end, we will be adding an auto-complete widget to the album/update form.


Learn how to easily integrate cross-table lookups using relationships and the listData method.


When we start mixing up models in our processes, it sometimes becomes unclear about where one should add a functionality. Here we will see both, adding an addComment function to the photo model and keeping the comment forms separate.


In smaller application development teams, it is easier to keep track of the development versus production configuration but even then it is important to be aware of overwriting the production configuration. In a larger system, it becomes imperative to split the configuration file into manageable portions.

Students Who Viewed This Course Also Viewed

  • Loading
  • Loading
  • Loading

Instructor Biography

Packt Publishing, Tech Knowledge in Motion

Packt has been committed to developer learning since 2004. A lot has changed in software since then - but Packt has remained responsive to these changes, continuing to look forward at the trends and tools defining the way we work and live. And how to put them to work.

With an extensive library of content - more than 4000 books and video courses -Packt's mission is to help developers stay relevant in a rapidly changing world. From new web frameworks and programming languages, to cutting edge data analytics, and DevOps, Packt takes software professionals in every field to what's important to them now.

From skills that will help you to develop and future proof your career to immediate solutions to every day tech challenges, Packt is a go-to resource to make you a better, smarter developer.

Packt Udemy courses continue this tradition, bringing you comprehensive yet concise video courses straight from the experts.

Ready to start learning?
Take This Course