I am new in cakephp 3.0 Now, What am I trying If I have any HTML template So, How can I integrate with cakephp.

Here, I am creating a controller: UsersController


    namespace App\Controller;
    use App\Controller\AppController;
    use Cake\ORM\TableRegistry;

    class UsersController extends AppController{
        public function index(){


$routes->connect('/', ['controller' => 'Users', 'action' => 'display', 'home']);
$routes->connect('/pages/*', ['controller' => 'Pages', 'action' => 'display']);

src/Template/Layout: index.ctp

    <?php echo $this->Html->charset(); ?>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <?php $this->Html->css('bootstrap.min.css'); ?>
    <h1>Welcome Cakephp</h1>
    <?php $this->Html->script('js/bootstrap.min.js'); ?>

When I open this on localhost then It show an error i.e. Error: Create UsersController::display() in file: src\Controller\UsersController.php.. So, How can I do this? Please help me.

Thank You

0 Answers