2011-06-30 8 views
1

私はユーザーが特定のグループに登録したいサイトを持っています。そのグループにアクセスするには、組織IDと組織パスワードを知る必要があります。CakePHP登録ページの構造化

私は私は、新しいユーザーを作成し、グループのIDとパスワードが存在し、正しいことを検証することができますフォームを作成しようとしています。私はUserフォームのすべてのフィールドを検証し、うまくいかないと自動的にエラーを出力させたいと思っています。皮肉なことに

、私は自分のアプリケーション「焼き」それが成功し、エラーメッセージを表示するフォームを作成します。しかし、何らかの理由で、カスタムフォームで検証エラーを表示することができません。

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

しかし、何も作業していない:私はこれをやっている

方法です!このタイプの登録フォームを構成する正しい方法とエラーの表示方法を教えてください。

また、私はその後、組織とユーザーを作成し、組織にユーザーを追加し、私は両方のユーザー情報や組織の情報に取っています同様の登録ページが必要になります。それはどのように構成されますか?

ありがとうございます!

答えて

1
<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));?> 

関連する問題