Add displayField and primaryKey to controller bake. Fixes #1192

Signed-off-by: mark_story <mark@mark-story.com>
This commit is contained in:
mark 2010-10-13 14:06:03 +02:00 committed by mark_story
parent d0c2b9c9d1
commit e16d21eaa3

View file

@ -282,9 +282,13 @@ class ControllerTask extends BakeTask {
$singularName = Inflector::variable($currentModelName);
$singularHumanName = $this->_singularHumanName($controllerName);
$pluralHumanName = $this->_pluralName($controllerName);
$displayField = $modelObj->displayField;
$primaryKey = $modelObj->primaryKey;
$this->Template->set(compact('plugin', 'admin', 'controllerPath', 'pluralName', 'singularName', 'singularHumanName',
'pluralHumanName', 'modelObj', 'wannaUseSession', 'currentModelName'));
$this->Template->set(compact('plugin', 'admin', 'controllerPath', 'pluralName', 'singularName',
'singularHumanName', 'pluralHumanName', 'modelObj', 'wannaUseSession', 'currentModelName',
'displayField', 'primaryKey'
));
$actions = $this->Template->generate('actions', 'controller_actions');
return $actions;
}