0

我不知道为什么表单teste只出现在foreach.

笔记:

<?php echo $this->Form->create(null, array(
            'url' => array('controller' => 'menus', 'action' => 'reprovar', $procuracao['Attorney']['id'])
             )); ?>`

这出现在foreach.

only的标签<FORM>出现<?php echo $this->Form->create('teste'); ?>在第一个结果中。

在每个元素中,都会出现文本区域和按钮。

完整代码:

<?php foreach ($procuracoes as $procuracao): ?>
                <td><?php echo $procuracao['Attorney']['nome']; ?></td>
                <td><?php echo $procuracao['Attorney']['estadocivil']; ?></td>
                <td><?php echo $procuracao['Attorney']['identidade'].'/'.$procuracao['Attorney']['expedidor']; ?></td>
                <td><?php echo $procuracao['Attorney']['cpf']; ?></td>
                <td><?php echo $procuracao['Attorney']['status']; ?></td>
                <td><ul>
                <?php foreach ($procuracao['Power'] as $power): ?>
            <li>    <?php echo $power['resumo'] ?> </li>
                <?php endforeach ?>
                </ul></td>

                <td>
                    <?php if($this->Session->read('Auth.User.id') == $procuracao['Attorney']['aprovador'] AND $procuracao['Attorney']['fluxo'] == 0 OR $this->Session->read('Auth.User.nivel') == 'administrador') : ?>
                    <div id="botoes-small">

                <ul>
                <input type="button" value="Aprovar" class="btn btn-success aprovar">
                <div class="formaprovar">

                <?php echo $this->Form->create('teste'); ?>
                <?php echo $this->Form->textarea('testerrr', array('placeholder' => 'teste')); ?>
                <?php echo $this->Form->submit('Ok', array('class' =>'btn btn-success', 'div' => false)); ?>

                </div>




                <input type="button" value="Reprovar" class="btn btn-danger reprovar">
                <div class="formreprovar">
                <?php echo $this->Form->create(null, array(
                'url' => array('controller' => 'menus', 'action' => 'reprovar', $procuracao['Attorney']['id'])
                )); ?>
                <?php echo $this->Form->textarea('motivo', array('placeholder' => 'Motivo')); ?>
                <?php echo $this->Form->submit('Ok', array('class' =>'btn btn-success pull-left', 'div' => false)); ?>
                </div>
                <?php endif; ?>
                </ul>
                    </div>

                    <?php if($this->Session->read('Auth.User.id') == $procuracao['Attorney']['aprovador'] AND $procuracao['Attorney']['fluxo'] == 1): ?>
                        <div class="alert alert-success">
                            <b>Aprovado</b>
                        </div>
                    <?php endif; ?>
                    <?php if($this->Session->read('Auth.User.id') == $procuracao['Attorney']['aprovador'] AND $procuracao['Attorney']['fluxo'] == 3): ?>
                        <div class="alert alert-error">
                            <b>Recusado</b>
                        </div>
                    <?php endif; ?>
                </td>

            </tr>
            <?php endforeach ?>
4

1 回答 1

0

快速查看后,如果该表单元素看起来像是在 IF 语句中发出的。你能试着把它拿出来吗?我不确定您何时需要或不需要输出表单标签,但这可能是阻止它的原因。

编辑——看起来你正在命名表单“teste”,第二个表单没有命名。尝试取出表单名称 - 也许它不喜欢它们被命名为相同的东西。

于 2013-08-16T17:34:02.270 回答