cakephpcakephp-2.6

cakephp 2.6 current location in model layer


I am in the model layer and want to make a switch() for the different prefixes like admin or api.

How can I get the request params I have in the Controller layer $this->request->params in the Model layer?


Solution

  • Router::getParams()
    

    This should do the job but, as AD7six said, don't do it