* Copyright (c) 2006, 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) 2006, Cake Software Foundation, Inc. * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project * @package cake * @subpackage cake.cake.libs.view.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); if(!empty($objModel->alias)) { foreach ($objModel->alias as $key => $value) { $alias[] = $key; } $count = 0; } ?>

Show

$value) { echo "
".$value['prompt']."
"; if(isset($value['foreignKey'])) { $otherModelObject =& ClassRegistry::getObject(Inflector::underscore($objModel->tableToModel[$value['table']])); $displayField = $otherModelObject->getDisplayField(); $displayText = $data[$alias[$count]][$displayField]; if(!empty($data[$objModel->tableToModel[$objModel->table]][$field]) && (isset($displayText))) { echo "
".$html->link($displayText, '/'.Inflector::underscore($value['controller']).'/show/' .$data[$objModel->tableToModel[$objModel->table]][$field] )."
"; } else { echo "
 
"; } $count++; } else { 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 "