* 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 "-
";
}
}
}
?>
".$html->link('Edit '.Inflector::humanize($objModel->name), '/'.$this->viewPath.'/edit/'.$data[$objModel->tableToModel[$objModel->table]][$this->controller->{$modelName}->primaryKey])."";
echo "- ".$html->link('Delete '.Inflector::humanize($objModel->name), '/'.$this->viewPath.'/destroy/'.$data[$objModel->tableToModel[$objModel->table]][$this->controller->{$modelName}->primaryKey])."
";
echo "- ".$html->link('List '.Inflector::humanize($objModel->name), '/'.$this->viewPath.'/index')."
";
echo "- ".$html->link('New '.Inflector::humanize($objModel->name), '/'.$this->viewPath.'/add')."
";
foreach( $fieldNames as $field => $value )
{
if( isset( $value['foreignKey'] ) )
{
echo "- ".$html->link( "List ".Inflector::humanize($value['controller']), "/".Inflector::underscore($value['controller'])."/index/")."
";
}
}
?>
hasOne as $association => $relation)
{
$model = $relation['className'];
$otherModelName = $objModel->tableToModel[$objModel->{$model}->table];
$controller = Inflector::pluralize($model);
$new = true;
echo "";
}
else
{
echo "- ".$html->link('New '.Inflector::humanize($association),"/".Inflector::underscore($controller)."/add/{$data[$association][$objModel->{$model}->primaryKey]}")."
";
}
}
}
?>
hasMany, $objModel->hasAndBelongsToMany);
foreach($relations as $association => $relation)
{
$model = $relation['className'];
$count = 0;
$otherModelName = Inflector::singularize($model);
$controller = Inflector::pluralize($model);
echo "