tags:

views:

34

answers:

2
$arrData = $this->params['url'];
$this->set('value',$this->params['url']['eslPageIndex']);
pr($value);

it throws Error:

Undefined variable: value [APP/controllers/esl_controller.php, line 34]

Please

HELP ME!!!!

+4  A: 
$this->set('value', ...);

means there will be a variable named $value made available in the view. It does not set it in the controller function. Hence pr($value) fails because there is no variable $value there.

deceze
If you want to see what you are setting the view variable `$value` to, you will need to `pr($this->params['url']['eslPageIndex'])`
cdburgess
A: 

^^^ theres your answer! I find it is often better to do like this to avoid your issue:

$myVar = ..something...;

$myVar2 = ...some other expression... ;

$this->set(compact('myVar','myVar2');

more readable and needs only one set call! you can also then use pr() in your controllerto debug

boobyWomack