I have written a separate action class which is called from a controller like this:
1) protected/controllers/SoccerController.php
class SoccerController extends Controller
{
public function actions() {
return array (
'index' => 'application\actions\soccer\IndexAction',
'teamlist' => 'application\actions\soccer\TeamListAction'
);
}
}
2) protected/actions/soccer/IndexAction.php
class IndexAction extends CAction
{
public $viewFile = 'teamoverview';
/**
* executes the action.
*/
public function run()
{
$team = new SoccerTeam();
$this->controller->render($this->viewFile, array('team'=>$team));
}
}
when I call url http://localhost/test/soccer/index I get a fatal error Cannot redeclare class IndexAction in C:\wamp\www\test\protected\actions\soccer\IndexAction.php on line 25
Can any body help me why this error occurs ?