Book Image

Yii Project Blueprints

By : Charles R. Portwood ll
Book Image

Yii Project Blueprints

By: Charles R. Portwood ll

Overview of this book

Table of Contents (15 chapters)
Yii Project Blueprints
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Migrating the functionality to the module


Now that our module is set up, we can start by moving the functionality from our application controllers and theme into our dashboard module. We'll go over everything that is needed for each model: Categories, Content, and Users.

Migrating content management

In this next section, we will migrate all of the management functionalities we built in the previous chapter into our new module:

  1. Starting with our ContentController, we first want to remove the actionAdmin(), actionSave(), and actionDelete() methods from the ContentController.php file at protected/controllers/.

  2. Next, we should remove the access control properties for the actions we just deleted from our ContentController. The restored accessRules() method should look as follows:

    public function accessRules()
    {
       return array(
          array('allow',
             'actions' => array('index', 'view', 'search'),
             'users' => array('*')
          ),
          array('deny',  // deny all users
             ...