我正在学习 CakePHP,我遵循这个教程:http: //book.cakephp.org/2.0/en/tutorials-and-examples/simple-acl-controlled-application/simple-acl-controlled-application.html
我正在使用 CakePHP 2.2.3。
好吧,我到了必须添加组和用户的地方。但是,我的数据库中没有我的组的名称......
你能帮助我吗?
组控制器:
    <?php
    class GroupesController extends AppController{
    function add(){
    if (!empty($this->data)) {
            if ($this->Groupe->save($this->data)) {
                $this->flash('Votre groupe a été sauvegardé.','/groupes');
            }
        }
    }
    function beforeFilter(){
        parent::beforeFilter();
        $this->Auth->allow('*');
    }
  }
    ?>
模型:
<?php
class Groupe extends AppModel{
    public $actsAs=array('Acl'=>array('type'=>'requester'));
    var $validate = array(
    'nom' => array(
    'rule' => array('minLength', 1)
    )
    );
    public function parentNode(){
        return null;
    }
}
?>
看法:
<h1>Ajouter un groupe</h1>
    <?php
        echo $this->Form->create('groupes');
        echo $this->Form->input('nom');
        echo $this->Form->end('Sauvegarder le groupe');
    ?>