name);
$modelKey = Inflector::underscore($modelName);
$registry = ClassRegistry::getInstance();
?>
$value ) {
echo "- ".$value['prompt']."
";
if( isset( $value['foreignKey'] ) ) {
$otherModelObject = $registry->getObject($value['model']);
$displayField = $otherModelObject->getDisplayField();
$displayText = $data[$value['model']][ $displayField ];
if( !empty($data[$modelKey][$field]))
{
echo "- ".$html->linkTo($displayText, '/'.Inflector::underscore($value['controller']).'/show/'.$data[$modelKey][ $field ] )."
";
}
else
{
echo "-
";
}
}
else
{
// this is just a plain old field.
if( !empty($data[$modelKey][$field]))
{
echo "- ".$data[$modelKey][$field]."
";
}
else
{
echo "-
";
}
}
}
?>
".$html->linkTo('Edit '.Inflector::humanize($modelKey), '/'.$this->viewPath.'/edit/'.$data[$modelKey]['id'])."";
echo "- ".$html->linkTo('Delete '.Inflector::humanize($modelKey), '/'.$this->viewPath.'/destroy/'.$data[$modelKey]['id'])."
";
foreach( $fieldNames as $field=>$value ) {
if( isset( $value['foreignKey'] ) )
{
echo "- ".$html->linkTo( "View ".Inflector::humanize($value['controller']), "/".Inflector::underscore($value['controller'])."/show/".$data[Inflector::singularize($params['controller'])][$field] )."
";
}
}
?>
getObject($modelName);
foreach ($objModel->_oneToOne as $relation)
{
list($table, $field, $value) = $relation;
$otherModelName = Inflector::singularize($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($table, $field, $value) = $relation;
$count = 0;
$otherModelName = Inflector::singularize($table);
echo "