How to pass vars to template?

How to pass vars to template?



Example, in payment/my_processor.php


<br />
	//Call to psp to get payoptions based on 'postdata'<br />
	$response = Http::post($url, $get_payalternatives);<br />
		  <br />
	// make selectlist for customer based on<br />
	foreach ($get_payalternatives as $key => $data) {<br />
	  //get/make vars for building selectlist to<br />
	  //customer based recieved data<br />
	}<br />
	// make new Http::post($url, $pay);<br />

```<br />
<br />
Here are my question, how do I pass variables to my template 'my_processor.tpl' so customer can choose from selectlist befor actual paycall?<br />
<br />
I guess I must do something like this to make/show selectlist for customer. Just like cc.tpl let users input dada to payprocessor.<br />
<br />
/gab

you can use $view->assign(“payalternatives”,$get_payalternatives) and do the foreach in the template.

If you don't have access to the $view variable, you can use Registry::get(“view”)->assign();

Can you upload o screenshot with the location of the selectlist ?





Valentin

[color=#808080][size=2]part of hungryweb.net[/size][/color]