0

I have a static html page in cakePHP application which I want to link in my route.php file. $routes->connect('/', ['controller' => 'Pages', 'action' => 'display', 'index']); It uses the controller file and adds header, footer, css, JS, etc to the index.ctp but how can I have the page as it is without adding code or using any controller? (like linking to static html page).

s_puria
  • 397
  • 1
  • 8
  • 19
  • I should also note that I have cpanel for controlling application. So, it is OK if I could set this option on cpanel – s_puria Jun 17 '16 at 18:17
  • 1
    I'm not sure what your asking. Do you want to use a different page as the home page or create another static page, like the home page? – Kev Wilson Jun 17 '16 at 18:32

1 Answers1

0

From what i understand you want to add a static page which does not inherit the default layout (Which is adding header and footer code). Why not

1) create another layout in the layouts folder and name it static.ctp

2)move css and scripts from your index.ctp to your new layout

3)create a condition in your display action to render the static.ctp layout instead of the default one if the request is specifically for index page

Lukesoft
  • 953
  • 1
  • 12
  • 31