I have a dashboard with a series of widgets. Per specification, the widgets need to be buried under a /widgets/ directory.
So I have added the following to my routes.php
Router::connect('/widget/:controller/:action/*', array());
But I seem to be running into trouble on widget/links/ and widget/links/view/1
I am new to CakePHP, but this doesn’t seem all that impressive. I have yet to find anything in the Book or by search. So any help is appreciated.
Thanks.
Well…at the risk of stating the obvious…your route starts with
/widget/, but you indicate that you’re trying to access it via a plural URI (/widgets/). That’s a problem. If that’s just a typo, it would help to know what error you’re seeing when you “run into trouble”.UPDATE:
Given that information, it appears that CakePHP thinks that
widgetis your controller. Cake processes routes top down and finds the first one that matches. Ensure that you don’t have a route above this one that looks something like/:controller/...or any other route above this one that starts with a variable.