Sonad Posted May 22, 2015 Report Share Posted May 22, 2015 Hi everyone, I am developing some addons for phpvms using codon framework. I have a question for you who are developers. How can we use __remap() function? Is there a __remap() function in codon framework like CodeIgniter? If there isn't, i really think that will be wonderfull. Best regards, Quote Link to comment Share on other sites More sharing options...
Members Vangelis Posted May 22, 2015 Members Report Share Posted May 22, 2015 As far as i know there is no such function i personal use a switch with post or get depending on the need for this usage Quote Link to comment Share on other sites More sharing options...
Tom Posted May 23, 2015 Report Share Posted May 23, 2015 My understanding is you want to handle calls to the module (class) for routes (functions) that might not exist? That right? codon itself might not have anything, but PHP has __call? public function __call($name, $args) { // ... } where $name is the first regular variable of your route: index.php/module/var/... and $args is an array containing all the rest: index.php/module/var/arg/arg/... This isn't so much remapping as handling calls to functions that don't exist, so if you visit index.php/module/action and function Module::action() exists, it will only call that function, not __call. Quote Link to comment Share on other sites More sharing options...
Sonad Posted May 23, 2015 Author Report Share Posted May 23, 2015 Thanks for reply, I want to get my variables directly to index function in my module. For example; www.mydomain.com/mymodule/123 I observed some modules (such as download) but they all dont use it. For example download module uses the dl function to get variables. Quote Link to comment Share on other sites More sharing options...
Tom Posted May 23, 2015 Report Share Posted May 23, 2015 Thanks for reply, I want to get my variables directly to index function in my module. For example; www.mydomain.com/mymodule/123 I observed some modules (such as download) but they all dont use it. For example download module uses the dl function to get variables. Do you want vars on your index as well as other functions? Or is that it? Either way you'll just have to write some logic in __call to deal with the various possibilities. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.