* Copyright (c) 2005, CakePHP Authors/Developers * * Author(s): Michal Tatarynowicz aka Pies * 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($modelName); ?>
$value) { echo "
".$value['prompt']."
"; if(isset($value['foreignKey'])) { $otherModelObject = $registry->getObject($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 "
 
"; } } } ?>
    ".$html->linkTo('Edit '.Inflector::humanize($objModel->name), '/'.$this->viewPath.'/edit/'.$data[$objModel->tableToModel[$objModel->table]]['id']).""; echo "
  • ".$html->linkTo('Delete '.Inflector::humanize($objModel->name), '/'.$this->viewPath.'/destroy/'.$data[$objModel->tableToModel[$objModel->table]]['id'])."
  • "; foreach( $fieldNames as $field => $value ) { if( isset( $value['foreignKey'] ) ) { echo "
  • ".$html->linkTo( "View ".Inflector::humanize($value['controller']), "/".Inflector::underscore($value['controller'])."/show/".$data[$objModel->tableToModel[$value['table']]]['id'] )."
  • "; } } ?>
_oneToOne as $relation) { list($table, $field, $value) = $relation; $otherModelName = $objModel->tableToModel[$table]; 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 "