I'm learning CakePHP and I follow this tuto: http://book.cakephp.org/2.0/en/tutorials-and-examples/simple-acl-controlled-application/simple-acl-controlled-application.html
I'm working with CakePHP 2.2.3.
Well, I arrived where I have to add groups and users. But, I've not the name of my groups in my database...
Can you help me?
GroupesController:
<?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('*');
}
}
?>
Model:
<?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;
}
}
?>
View:
<h1>Ajouter un groupe</h1>
<?php
echo $this->Form->create('groupes');
echo $this->Form->input('nom');
echo $this->Form->end('Sauvegarder le groupe');
?>