From b1ff00d0d34c1af5a8eccd7d0b614011d3052395 Mon Sep 17 00:00:00 2001 From: the_undefined Date: Mon, 19 May 2008 05:38:32 +0000 Subject: [PATCH] Made schema available to bake view templates, fixes #4216 git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6949 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/console/libs/tasks/view.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cake/console/libs/tasks/view.php b/cake/console/libs/tasks/view.php index a2db46dab..3e71dfb54 100644 --- a/cake/console/libs/tasks/view.php +++ b/cake/console/libs/tasks/view.php @@ -260,7 +260,8 @@ class ViewTask extends Shell { $pluralVar = Inflector::variable($this->controllerName); $singularHumanName = Inflector::humanize($modelClass); $pluralHumanName = Inflector::humanize($this->controllerName); - $fields = array_keys($modelObj->schema()); + $schema = $modelObj->schema(); + $fields = array_keys($schema); $associations = $this->__associations($modelObj); } else { $primaryKey = null; @@ -270,10 +271,11 @@ class ViewTask extends Shell { $singularHumanName = Inflector::humanize(Inflector::singularize($this->controllerName)); $pluralHumanName = Inflector::humanize($this->controllerName); $fields = array(); + $schema = array(); $associations = array(); } - return compact('modelClass', 'primaryKey', 'displayField', 'singularVar', 'pluralVar', + return compact('modelClass', 'schema', 'primaryKey', 'displayField', 'singularVar', 'pluralVar', 'singularHumanName', 'pluralHumanName', 'fields','associations'); } /**