Welcome Guest, Not a member yet? Register   Sign In
How can you make $this->validation->THISPART_error dynamic?
#1

[eluser]codex[/eluser]
The object is to change THISPART (if it wasn't clear). Is it possible?

EDIT: never mind :coolsmirk:
#2

[eluser]gon[/eluser]
Do you mean this?

$this->validation->{$thispart}_error
#3

[eluser]Computerzworld[/eluser]
Hello,
I am facing the same problem. I am trying to generate $this->validation variables dynamically in for loop something like

Code:
for($i=1;$i<5;$i++)
{
        $this->validation->var.$i = some value...
}

or
Code:
for($i=1;$i<5;$i++)
{
        $this->validation->var{$i} = some value...
}



but it doesn't works for me. So whats the exact syntax for it? Please help me. Thanks in advance.
#4

[eluser]Computerzworld[/eluser]
its solved....
actually i was trying to do something like this...

Code:
$this->validation->var{$obj->val}

that was not worked for me...

so i splitted the object in key value pair and it worked..




Theme © iAndrew 2016 - Forum software by © MyBB