Error handling 构造CakePHP注册页面

Error handling 构造CakePHP注册页面,error-handling,cakephp-1.3,Error Handling,Cakephp 1.3,我有一个网站,我希望用户注册到特定的组。为了访问该组,您需要知道他们的组织ID和组织密码 我正在尝试创建一个表单,它允许我验证组ID和密码是否存在并且正确,然后创建一个新用户。我想验证用户表单中的所有字段,如果它们不起作用,让它们自动神奇地打印错误 讽刺的是,当我“烘焙”我的应用程序时,它创建的表单成功地显示了错误消息。但由于某些原因,我无法让它打印出自定义表单中的任何验证错误 我这样做的方式是: <div class="full center"> <?

我有一个网站,我希望用户注册到特定的组。为了访问该组,您需要知道他们的组织ID和组织密码

我正在尝试创建一个表单,它允许我验证组ID和密码是否存在并且正确,然后创建一个新用户。我想验证用户表单中的所有字段,如果它们不起作用,让它们自动神奇地打印错误

讽刺的是,当我“烘焙”我的应用程序时,它创建的表单成功地显示了错误消息。但由于某些原因,我无法让它打印出自定义表单中的任何验证错误

我这样做的方式是:

<div class="full center">
        <?
            echo $this->Session->flash();
            echo $this->Session->flash('auth');
        ?>
        <h3>Organization ID / Registration Code</h3>
        <?php 
            echo $this->Form->create('User', array('action'=>'register_user'));
            echo $this->Form->input('Organization.id', array('type'=>'text', 'label' => 'Organization ID'));
            echo $this->Form->input('Organization.registration_code', array('label' => 'Organization Registration Code')); ?>
        <h3>User Account Information </h3>
        <?php
            echo $this->Form->input('User.email');
            echo $this->Form->input('User.password', array('value'=>''));
            echo $this->Form->input('User.name');
            echo $this->Form->input('User.xxxx');
            echo $this->Form->input('User.xxxx');
            echo $this->Form->input('User.xxxx');
            echo $this->Form->input('User.xxxx');
        ?>
        <div><input type="checkbox" name="data[tos][agree]"> I agree to the Terms of Service.</div>
        <div><input type="checkbox" name="data[pp][agree]"> I agree to the Privacy Policy.</div>
        <?php echo $this->Form->end(__('Join my Organization', true));?>
</div>

组织ID/注册码
用户帐户信息
我同意服务条款。
我同意隐私政策。
但是什么都没用!请让我知道,如果这是正确的方式来构造这种类型的注册表,以及如何让我的错误显示

此外,我还需要一个类似的注册页面,在该页面中,我同时获取用户信息和组织信息,然后创建组织和用户,并将用户添加到组织中。这将如何组织

谢谢


<div class="full center">
    <?
        if($session->check('Message.flash')) 
      { 
        echo $this->Session->flash();
        echo $this->Session->flash('auth');
       }
    ?>
    <h3>Organization ID / Registration Code</h3>
    <?php 
        echo $this->Form->create('User', array('action'=>'register_user'));
        echo $this->Form->input('Organization.id', array('type'=>'text', 'label' => 'Organization ID'));
        echo $this->Form->input('Organization.registration_code', array('label' => 'Organization Registration Code')); ?>
    <h3>User Account Information </h3>
    <?php
        echo $this->Form->input('User.email');
        echo $this->Form->input('User.password', array('value'=>''));
        echo $this->Form->input('User.name');
        echo $this->Form->input('User.xxxx');
        echo $this->Form->input('User.xxxx');
        echo $this->Form->input('User.xxxx');
        echo $this->Form->input('User.xxxx');
    ?>
    <div><input type="checkbox" name="data[tos][agree]"> I agree to the Terms of Service.</div>
    <div><input type="checkbox" name="data[pp][agree]"> I agree to the Privacy Policy.</div>
    <?php echo $this->Form->end(__('Join my Organization', true));?>
组织ID/注册码 用户帐户信息 我同意服务条款。 我同意隐私政策。


组织ID/注册码
用户帐户信息
我同意服务条款。
我同意隐私政策。