* Copyright (c) 2005, Cake Software Foundation, Inc. * 1785 E. Sahara Avenue, Suite 490-204 * Las Vegas, Nevada 89104 * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource * @copyright Copyright (c) 2005, Cake Software Foundation, Inc. * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project * @package cake * @subpackage cake.cake.libs.controller.templates.scaffolds * @since CakePHP v 0.10.0.1076 * @version $Revision$ * @modifiedby $LastChangedBy$ * @lastmodified $Date$ * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ ?> name); $modelKey = Inflector::underscore($modelName); $objModel = ClassRegistry::getObject($modelKey); ?>

Show

$value) { echo "
".$value['prompt']."
"; if(isset($value['foreignKey'])) { $alias = array_search($value['table'],$objModel->alias); $otherModelObject = ClassRegistry::getObject(Inflector::underscore($objModel->tableToModel[$value['table']])); $displayField = $otherModelObject->getDisplayField(); $displayText = $data[$alias][$displayField]; if(!empty($data[$objModel->tableToModel[$objModel->table]][$field])) { echo "
".$html->link($displayText, '/'.Inflector::underscore($value['controller']).'/show/' .$data[$objModel->tableToModel[$objModel->table]][$field] )."
"; } else { echo "
 
"; } } else { // this is just a plain old field. if( !empty($data[$objModel->tableToModel[$objModel->table]][$field])) { echo "
".$data[$objModel->tableToModel[$objModel->table]][$field]."
"; } else { echo "
 
"; } } } ?>
hasOne as $association => $relation) { $model = $relation['className']; $otherModelName = $objModel->tableToModel[$objModel->{$model}->table]; $controller = Inflector::pluralize($model); $new = true; echo ""; } else { echo ""; } } } ?> hasMany, $objModel->hasAndBelongsToMany); foreach($relations as $association => $relation) { $model = $relation['className']; $count = 0; $otherModelName = Inflector::singularize($model); $controller = Inflector::pluralize($model); echo "