简体   繁体   中英

How to pass 2 variables in viewVars

  $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(); 

i need to send two variables on my view $message[0] & $message[1] in viewVars. How do achieve this? Please help.

You only need to do this, $this->set('message', $message); and then in you view will you have $message[0] and [1]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM