On 2 jun, 14:20, Jaime <[EMAIL PROTECTED]> wrote:
> Cake's admin routes are nice, but are designed for a simpler scenario
> (Users vs. Admins), so won't help here.

Since CakePHP 1.2 there is the possibility to define custom prefix
routing, so it can be possible to do something like:

Router::connect('/brokers/contract/edit', array('prefix' =>
'brokers'));
Router::connect('/laywers/contract/edit', array('prefix' =>
'laywers'));
Router::connect('/managers/contract/edit', array('prefix' =>
'managers'));

And then define the contract_controller like:

class contract_controller extends AppController {

  function brokers_edit($id) {
    ...my_private_method...
  }

  function managers_edit($id) {
    ...my_private_method...
  }

  function lawyers_edit($id) {
    ...my_private_method...
  }

}

Which looks to me better than the horrible if/elseif/elseif structure
suggested before.

Any guru out there willing to give a piece of advice on how to improve
this?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to