简体   繁体   中英

Alternative for Router::requestAction in cakephp 2.x or calling controller action from route file

Router::requestAction has been removed in cakephp 2.x I need to call the action from route pages. Actually i want to update the cache for the url and from that i want to route the incoming pages. It was possible in 1.3 but no more used in higher version. How can i access the controller function when system checks on the route setting?

Router::requestAction() never existed even in 1.3. The function you are referring to is probably Object::requestAction() and is available in 2.x also. But in 2.x Router doesn't extends Object anymore and hence the function is not available. Still I don't see why you need to call a controller action to update your url cache. I presume you have routes and/or url slugs stored in db which you need and for that you should have a model function which returns the required info.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM