O'Reilly logo

Yii Rapid Application Development Hotshot by James R. Hamilton III, Lauren J. O'Meara

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a Mobile View Widget

We will create a widget to customize the list view for books. When we are finished, the mobile view for the book list will look a lot better.

Engage Thrusters

  1. We will create a directory for our extension to keep everything together. Create an extensions directory in ~/ch2/protected as follows:
      cd ~/projects/cbdb/ch2/protected
      mkdir extensions
    
  2. Make a directory for the widget under extensions named mobile.
      cd ~/projects/cbdb/ch2/protected/extensions
      mkdir mobile
    
  3. In the widget directory, create a file named ListView with an init and run function. The init function will prepare any assets that your view needs, but our mobile layout has already taken care of this for us. The run function will render the widget.
    <?php ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required