* Copyright (c) 2005, CakePHP Authors/Developers * * Author(s): Larry E. Masters aka PhpNut * Kamil Dzielinski aka Brego * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource * @author CakePHP Authors/Developers * @copyright Copyright (c) 2005, CakePHP Authors/Developers * @link https://trac.cakephp.org/wiki/Authors Authors/Developers * @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); $registry =& ClassRegistry::getInstance(); $objModel = $registry->getObject($modelKey); ?>

Show

$value) { echo "
".$value['prompt']."
"; if(isset($value['foreignKey'])) { $otherModelObject = $registry->getObject(Inflector::underscore($objModel->tableToModel[$value['table']])); $displayField = $otherModelObject->getDisplayField(); $displayText = $data[$objModel->tableToModel[$value['table']]][$displayField]; if(!empty($data[$objModel->tableToModel[$objModel->table]][$field])) { echo "
".$html->linkTo($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 "
 
"; } } } ?>
_oneToOne as $relation) { list($model, $value) = $relation; $otherModelName = $objModel->tableToModel[$model]; $controller = Inflector::pluralize($model); echo ""; } ?> _oneToMany as $relation ) { $relations[] = $relation; } // end loop through onetomany relations. foreach( $objModel->_manyToMany as $relation ) { $relations[] = $relation; } // end loop through manytomany relations. foreach( $relations as $relation ) { list($model, $value) = $relation; $count = 0; $otherModelName = Inflector::singularize($model); $controller = Inflector::pluralize($model); echo "