Jump to content

Cake - How to make an inert page (one that doesnt need a controller etc.)


Recommended Posts

I have a number of different database tables of substances (i.e. fungi, compounds, products, taxonomy) etc. and I want to put it all under the umbrella of "substances". I setup prefix routing so I can have URLs like this: /Substances/CompoundsController and it works, but its still using my "substances" table which I want to get rid of, so what I wanna do is have an ordinary page when you go to /Substances/, it'll link to the different substance pages, but I can't have it looking for a substances model, controller and views. Heres the my core.php file:

Configure::write('Routing.prefixes', array('admin','Substances')); 

and heres what I started adding to the routes file:

Router::connect('/Substances/', array('controller' => 'Substances', 'action' => 'index'));
Router::connect('/Substances/Compounds/', array('controller' => 'Substances', 'action' => 'index','Compounds')); 

the problem there is I'm telling it that theres a Substances controller, so its gonna look for a controller, a model and views etc. What I need is a place page for /Substances/, the controllers will be for the /Substances/Compounds and stuff like that. Is there a way I can turn this into a regular page?

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.