I'm a new student in CakePHP 3 please resolve my problem. This is my controller file:
DirectUseController.php
<?php
class DirectUseController extends AppController {
function index() {
$this->layout = 'directuse';
}
}
?>
This is my layout file:
directuse.ctp
<!DOCTYPE html>
<html>
<head>
<title>
<?= $this->fetch('title') ?>
</title>
</head>
<body>
<a href="#"> Bootstrap </a> | <a href="#"> Foundation </a> | <a href="#"> Materilize </a>
<br><br>
Copyright
<br><br>
</body>
</html>
This is my index file in folder of direct use index.ctp
<section id="mainBody">
hello
</section>
and my folder structure is:

What am I missing?
$this->layout = 'directuse'will give a error. In that case you must use$this->viewBuilder()->setLayout('directuse');.