I have two functions in my controller. There are few fields in my view(say name, email). When I'm trying to access them from function1 it does not work. It says undefined variable:name (it is also defined in model)
public function function1()
{
$name= $_POST['name'] //displays error
}
public function actionContact()
{
$model=new ContactForm;
if(isset($_POST['ContactForm']))
{
$this->function1();
}
}