Cakephp3表单按钮提交在向导

时间:2016-03-14 15:56:23

标签: html5 forms cakephp-3.0

当我点击按钮提交无效工作时,我有一种html5的注册形式。

<form class="form-horizontal" accept-charset="utf-8" method="post" action="/FOCompetence/users/inscription">
                <div style="display:none;"><input type="hidden" name="_method" value="POST"></div>

我使用了

形式的向导

<div class="panel-footer">
            <ul class="pager">
                <li class="previous disabled">
                    <a><i class="fa fa-angle-left"></i> Précédant</a>
                </li>
                <li class="finish hidden pull-right">
                    <button type="submit" class="btn btn-borders btn-primary"> Enregister</button>
                </li>
                <li class="next">
                    <a>Suivant <i class="fa fa-angle-right"></i></a>
                </li>
            </ul>
        </div></form>

我在动作中尝试了许多命题,比如action =“”,action =“#”,action =“inscription.ctp”和action =“inscription”,没有任何工作 我在UsersController中的题词方法代码是:public function inscription() { $user = $this->Users->newEntity(); if ($this->request->is('post')) { $user = $this->Users->patchEntity($user, $this->request->data); if ($this->Users->save($user)) { $this->Flash->success(__('Welcome ^_^.')); return $this->redirect(['action' => 'view']); } else { $this->Flash->error(__('Please, try again.')); } } $this->set(compact('user')); $this->set('_serialize', ['user']); }

0 个答案:

没有答案