Question

I have a problem: I have these tables in DB:

  • Users
  • Empresas (enterprises) ("hasMany users" and "hasMany documents")
  • Documents
  • And many other related to "Empresas"

And after cake bake all for "documents", the code generated for views (example Documents/view) is always the code for Users:

<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>

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top