Namespace and modules

Hello All
I am trying to create a module in my yii based app and due to clash in class names I need to use namespaces. The problem is I am constantly facing the

Unable to resolve the request "payroll/department/create".

My directory structure is as follows

protected/modules/payroll

PayrollModule.php

protected/modules/payroll.controllers

DepartmentController.php
TaskController.php

protected/modules/payroll/models

Department.php
Task.php

the initial lines of all files are

PayrollModule.php

namespace payroll;
class PayrollModule extends \CWebModule {

modules/payroll/controllers/DepartmentController.php

namespace payroll\controllers;
class DepartmentController extends \Controller {

modules/payroll/models/Department.php

namespace payroll\models;
class Department extends \CActiveRecord {

Also in config.php
// adding namespaces
Yii::setPathOfAlias('payroll', dirname(__DIR__) . '/protected/modules/payroll');

return array(

‘payroll’ => array(
‘moduleName’ => ‘payroll’,
‘class’ => ‘payroll\PayrollModule’,
),

);

any help is appreciated.

404
It seems you have routing problems.
Check that your namespace Is correctly registered.
Check that your controller is correctly registered.
Then check the create action with no code. Just return simple text.

For namespace settings
https://www.yiiframework.com/doc/guide/1.1/en/basics.namespace

OK, the problem is resolved now.
The main thing in this regard is to have a controller map in PayrollModule.php
public $controllerMap = array( 'task' => '\payroll\controllers\TaskCotnroller', 'commission' => '\payroll\controllers\CommissionController', 'department' => '\payroll\controllers\DepartmentController', 'employee' => '\payroll\controllers\EmployeeController', 'employeeCommission' => '\payroll\controllers\EmployeeCommissionController', 'employeeToCustomer' => '\payroll\controllers\EmployeeToCustomerController', 'employeeToStore' => '\payroll\controllers\EmployeeToStoreController', 'increment' => '\payroll\controllers\IncrementController', 'salary' => '\payroll\controllers\SalaryController', 'taskAssignment' => '\payroll\controllers\TaskAssignmentController', 'task' => '\payroll\controllers\TaskController', );

Only this array resolves the problem.