Raccourci de debug + fix Crises -> Crisis
This commit is contained in:
parent
24d634bb78
commit
c85ff22006
src
@ -19,7 +19,7 @@ class InfosController extends AppController
|
||||
public function index()
|
||||
{
|
||||
$this->paginate = [
|
||||
'contain' => ['Crises', 'Users']
|
||||
'contain' => ['Crisis', 'Users']
|
||||
];
|
||||
$this->set('infos', $this->paginate($this->Infos));
|
||||
$this->set('_serialize', ['infos']);
|
||||
@ -35,7 +35,7 @@ class InfosController extends AppController
|
||||
public function view($id = null)
|
||||
{
|
||||
$info = $this->Infos->get($id, [
|
||||
'contain' => ['Crises', 'Users']
|
||||
'contain' => ['Crisis', 'Users']
|
||||
]);
|
||||
$this->set('info', $info);
|
||||
$this->set('_serialize', ['info']);
|
||||
@ -58,9 +58,9 @@ class InfosController extends AppController
|
||||
$this->Flash->error(__('The info could not be saved. Please, try again.'));
|
||||
}
|
||||
}
|
||||
$crises = $this->Infos->Crises->find('list', ['limit' => 200]);
|
||||
$Crisis = $this->Infos->Crisis->find('list', ['limit' => 200]);
|
||||
$users = $this->Infos->Users->find('list', ['limit' => 200]);
|
||||
$this->set(compact('info', 'crises', 'users'));
|
||||
$this->set(compact('info', 'Crisis', 'users'));
|
||||
$this->set('_serialize', ['info']);
|
||||
}
|
||||
|
||||
@ -85,9 +85,9 @@ class InfosController extends AppController
|
||||
$this->Flash->error(__('The info could not be saved. Please, try again.'));
|
||||
}
|
||||
}
|
||||
$crises = $this->Infos->Crises->find('list', ['limit' => 200]);
|
||||
$Crisis = $this->Infos->Crisis->find('list', ['limit' => 200]);
|
||||
$users = $this->Infos->Users->find('list', ['limit' => 200]);
|
||||
$this->set(compact('info', 'crises', 'users'));
|
||||
$this->set(compact('info', 'Crisis', 'users'));
|
||||
$this->set('_serialize', ['info']);
|
||||
}
|
||||
|
||||
|
@ -10,7 +10,7 @@ use Cake\Validation\Validator;
|
||||
/**
|
||||
* Infos Model
|
||||
*
|
||||
* @property \Cake\ORM\Association\BelongsTo $Crises
|
||||
* @property \Cake\ORM\Association\BelongsTo $Crisis
|
||||
* @property \Cake\ORM\Association\BelongsTo $Users
|
||||
*/
|
||||
class InfosTable extends Table
|
||||
@ -32,7 +32,7 @@ class InfosTable extends Table
|
||||
|
||||
$this->addBehavior('Timestamp');
|
||||
|
||||
$this->belongsTo('Crises', [
|
||||
$this->belongsTo('Crisis', [
|
||||
'foreignKey' => 'crisis_id',
|
||||
'joinType' => 'INNER'
|
||||
]);
|
||||
@ -78,7 +78,7 @@ class InfosTable extends Table
|
||||
*/
|
||||
public function buildRules(RulesChecker $rules)
|
||||
{
|
||||
$rules->add($rules->existsIn(['crisis_id'], 'Crises'));
|
||||
$rules->add($rules->existsIn(['crisis_id'], 'Crisis'));
|
||||
$rules->add($rules->existsIn(['user_id'], 'Users'));
|
||||
return $rules;
|
||||
}
|
||||
|
@ -54,7 +54,10 @@
|
||||
<section class="top-bar-section">
|
||||
<!-- Right Nav Section -->
|
||||
<ul class="right">
|
||||
<li class="active"><a href="#">Right Button Active</a></li>
|
||||
<li class="active"><?= $this->Html->link("Articles",['controller' => 'Articles', 'action' => 'index'], ['class' => 'expended button']); ?></li>
|
||||
<li class="active"><?= $this->Html->link("Users",['controller' => 'Users', 'action' => 'index'], ['class' => 'expended button']); ?></li>
|
||||
<li class="active"><?= $this->Html->link("Infos",['controller' => 'Infos', 'action' => 'index'], ['class' => 'expended button']); ?></li>
|
||||
<li class="active"><?= $this->Html->link("Crisis",['controller' => 'Crisis', 'action' => 'index'], ['class' => 'expended button']); ?></li>
|
||||
<li class="has-dropdown">
|
||||
<a href="#">Right Button Dropdown</a>
|
||||
<ul class="dropdown">
|
||||
|
Loading…
x
Reference in New Issue
Block a user