0

I want to grab a variable from an url for redirects in my cakephp app ie

example.com/value -> example.com/controller/this:value

obviously, the rest of the routing should remain intact. Is this possible with routing in cakephp?

Im using cakephp 1.3

I want to check the URL first against a field in a database table, if it doesnt exist, then pass it through routing. I'm assuming this will be in the beforeFilter of the app controller.

2
  • can you be a little bit more precise? also, you should state your exact cake version. Commented Mar 13, 2013 at 14:58
  • ive added more detail and my version. Commented Mar 13, 2013 at 15:43

1 Answer 1

1

AFAIK, you cannot access the database prior to the routes.php.

Just as you assumed, the alternative would be to build your logic into the beforeFilter of the AppController, which should be fine.

Probably something you'll want to cache though, since it will hit on EVERY page load.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.