Create controller, model and view

Hi, I’ve just started to use cakephp but I have a lot of doubts.

First of all:

When I create a Controller, model and view wit a DB conection with:

cake bake all “name” it works fine but when I need no DB for one part of my webpage I can’t do anything because it don’t work.

So I delete this files:

And add the following line in routes.php

$routes->connect(’/’, [‘controller’ => ‘Pages’, ‘action’ => ‘display’, ‘inicio’]);

This works, but when I do this I can’t see my layout in my page

I have the conection to Bootstrap and my header and footer in the layout but now I don’t work, and now I don’t have a controller to do my code in.

How can I do a controller model and view without a DB?


Hey Brokhael,

If you want to see your created page in the front-end and you don’t have the DB, no need to create the table file and entity file. But you have to create controller which will have the methods and then in Templates the view files.

I want to create a new action y my webpage but without a DB but I don’t know how.

refer this :