如何在viewVars中传递2个变量

时间:2015-05-29 11:46:25

标签: cakephp cakeemail

       $message[0]  = $unique_password[0]['users']['firstname'];
		
		$message[1]='Please click on this link to reset your password: http://test.com/reset_password?password='.$unique_password;


		$Email = new CakeEmail();
		$Email->config('smtp');
		***$Email->viewVars($message[0],$message[1]);***
		$Email->template('forgetpassword')
		->emailFormat('html')
		->to($email)
		->from('app@domain.com')
		->subject('Password: Urbanbeauty Network')
		->send();

我需要在我的视图上发送两个变量$ message [0]& viewVars中的$ message [1]。怎么做到这一点?请帮忙。

1 个答案:

答案 0 :(得分:0)

你只需要这样做,$ this-> set(' message',$ message);然后在你看来你会有$ message [0]和[1]