I have just started working with Symfony. I downloaded the sf_sandbox and I am having trouble with $sf_params. When I try to use any methods on it, such as $sf_params->has('status') I get the error:
Notice: Undefined variable: sf_params
in
/var/www/sf_sandbox/apps/frontend/modules/login/actions/actions.class.php
on line 14 Fatal error: Call to a
member function has() on a non-object
in
/var/www/sf_sandbox/apps/frontend/modules/login/actions/actions.class.php
on line 14
Here is the block:
public function executeIndex() {
if ($sf_params->has('status') && $sf_params->has('message')) { // <--line 14
if ($sf_params->get('status') == 'failed') {
$this->message = $sf_params->get('message');
}
}
}
As The.Anti.9 stated, you must use $request when writing code inside an Action file.
You will need to replace your function definition as follows:
I hope that helps.
Edit: Just realized you answered your own question.