ビューのメソッド
<?php
$this->set('color', 'pink');
$this->viewBuilder()
->setLayout('admin')
->helpers(['MyCustom'])
->theme('Modern')
->className('Modern.Admin');
$this->render('custom_file');
$this->redirect(['controller' => 'Users', 'action' => 'new']);
$this->redirect(['controller' => 'Users', 'action' => 'creare', $user]);
$this->loadModel('Article');
public function initialize()
{
parent::initialize();
$this->loadComponent('Csrf');
$this->loadComponent('Comments', Configure::read('Comments'));
}
?>