(Fixes issue 1061)

This commit is contained in:
qiang.xue
2010-03-26 18:29:12 +00:00
parent 5aeee8ef47
commit 01964cf811
3 changed files with 14 additions and 7 deletions

View File

@@ -43,7 +43,7 @@ class ControllerCode extends CCodeModel
foreach($this->getActionIDs() as $action)
{
$this->files[]=new CCodeFile(
Yii::app()->viewPath.'/'.$this->controller.'/'.$action.'.php',
Yii::app()->viewPath.'/'.$this->controllerID.'/'.$action.'.php',
$this->render($templatePath.'/view.php', array('action'=>$action))
);
}
@@ -60,9 +60,17 @@ class ControllerCode extends CCodeModel
public function getControllerID()
{
if(($pos=strrpos($this->controller,'/'))!==false)
return substr($this->controller,$pos+1);
{
$id=substr($this->controller,$pos+1);
$id[0]=strtolower($id[0]);
return substr($this->controller,0,$pos).'/'.$id;
}
else
return $this->controller;
{
$id=$this->controller;
$id[0]=strtolower($id[0]);
return $id;
}
}
public function getControllerClass()