Now that our application is set up, we can begin to create our module. We'll start by creating the basic folder structure within our protected/modules
directory:
protected/ [...] modules/ /dashboard assets/ components/ config/ controllers/ views/ layouts/ user/ category/ filemanager/ default/
As you can see, the basic structure of our module looks identical to that of our main application. With our folder structure in place, we now need to create the DashboardModule
class that we'll later tell Yii about so that it knows what to load. The steps are as follows:
Start by creating a new file, called
DashboardModule.php
, withinprotected/modules/dashboard
with the following definition:<?php class DashboardModule extends CWebModule {}
Then, create an
init()
method for the module:public function init() {}
Within the module, we'll want to set the
layoutPath
so that...