Welcome Guest, Not a member yet? Register   Sign In
Not compatible ? : "_remap" function and "Passing URI Segments to your Functions"
#9

[eluser]Solito[/eluser]
Hi,


Yes, I think too that _remap should be rewritten :
_remap is the front door of our software architecture and my opinion is that this door is too weak to bear all the functionnalities CI controllers deserve.
Just imagine the security options (or anything else) you could manage before calling any controller, like data validation etc.
Then, the controller would be simpler, meaning a better architecture and more factorization... CI style, what...

But I think there could be a confusion, controller-side speaking.
The controller can have parameters passed in two ways :
1 - as usual, via URI segments
Code:
// for example : a search function
function seek_profile($var1='',$var2='') {
## here, var1 is equal to $this->uri->segment(3) ;
$elts = explode('-',$var1) ; // this is just for the example
## and now treatment
}
2 - via _remap, who can make a treatment on those parameters
Problem is : when you call the controller, which variable will be assigned ?
Code:
// example 2
function _remap($var_a='',$var_b=''){
// here it's var_a that equals this->uri->segment(3)
$var_a = filter_var($var_a,FILTER_VALIDATE_STRING); // example
}

function seek_profile($var1='',$var2){
$elts = explode('-',$var1) ;
## bla bla bla
}
Is var1 equal to segment(3) or to var_a ?
Must _remap override var1 or not ?

Or maybe this can be switchable via a config parameter ? I don't know. I'm only a summer student, you know :coolsmile:


Messages In This Thread
Not compatible ? : "_remap" function and "Passing URI Segments to your Functions" - by El Forum - 09-21-2009, 02:57 AM



Theme © iAndrew 2016 - Forum software by © MyBB