0

In CakePHP, is there a way to set admin routing on an URL like this:

...com/admin/articles/

to go to:

View/Admin/Articles/index.ctp

instead of:

View/Articles/admin_index.ctp

My thought is, it would be nice to keep my admin files more separate from my front-end files, since I'd like to re-use my admin over many projects. If this can be done, are their negative side-effects I haven't thought of?

Dave
  • 28,833
  • 23
  • 113
  • 183

2 Answers2

1

Just set Controller::$viewPath to whatever you need. In your AppController::beforeRender() set $this->viewPath = 'Admin/' . $this->name;

ADmad
  • 8,102
  • 16
  • 18
-1

why don't you create a separate app for your admin? Or create a plugin with it? With that you could reuse it in all your projects.

fsilva
  • 71
  • 4