CakePHP:“蛋糕烘焙所有”创建始终相同的代码

时间:2013-07-18 08:39:37

标签: cakephp cakephp-bake

我有一个问题:我在DB中有这些表:

  • 用户
  • Empresas(企业)(“hasMany users”和“hasMany documents”)
  • 文档
  • 与“Empresas”相关的许多其他内容

在蛋糕为“文档”烘焙后,为视图生成的代码(示例文档/视图)始终是用户的代码:

<div class="documentosDocs view">
<h2><?php  echo __('Documentos Doc'); ?></h2>
<dl>
    <dt><?php echo __('Id'); ?></dt>
    <dd>
        <?php echo h($user['User']['id']); ?>
        &nbsp;
    </dd>
    <dt><?php echo __('Empresa'); ?></dt>
    <dd>
        <?php echo $this->Html->link($user['Empresa']['id'], array('controller' => 'empresas', 'action' => 'view', $user['Empresa']['id'])); ?>
        &nbsp;
    </dd>
    <dt><?php echo __('Username'); ?></dt>
    <dd>
        <?php echo h($user['User']['username']); ?>
        &nbsp;
    </dd>
    <dt><?php echo __('Password'); ?></dt>
    <dd>
        <?php echo h($user['User']['password']); ?>
        &nbsp;
    </dd>
    <dt><?php echo __('NombreCompleto'); ?></dt>
    <dd>
        <?php echo h($user['User']['nombreCompleto']); ?>
        &nbsp;
    </dd>
    <dt><?php echo __('Email'); ?></dt>
    <dd>
        <?php echo h($user['User']['email']); ?>
        &nbsp;
    </dd>
    <dt><?php echo __('Role'); ?></dt>
    <dd>
        <?php echo h($user['User']['role']); ?>
        &nbsp;
    </dd>
    <dt><?php echo __('Group'); ?></dt>
    <dd>
        <?php echo $this->Html->link($user['Group']['name'], array('controller' => 'groups', 'action' => 'view', $user['Group']['id'])); ?>
        &nbsp;
    </dd>
    <dt><?php echo __('Created'); ?></dt>
    <dd>
        <?php echo h($user['User']['created']); ?>
        &nbsp;
    </dd>
    <dt><?php echo __('Modified'); ?></dt>
    <dd>
        <?php echo h($user['User']['modified']); ?>
        &nbsp;
    </dd>
</dl>
</div>

0 个答案:

没有答案