views:

18

answers:

1

i have a custom helper written which returns the html form as string which extends the Zend_view-hepler_Abstract Now i have 3 helpers .How do i assign each helper to a different view . It is something like this in the controller

class abc extends Zend_controller_front{

public action page1Action (){
// I want to use a different Helper 
 //How do i assign custom1 helper to this view Separately 

}
public action page2Action (){
// I want to use a different Helper 
//How do i assign custom2 helper to this view Separately 

}

 public action page3Action (){
// I want to use a different Helper 
//How do i assign custom3 helper to this view Separately 

}


 } 
+1  A: 

um, should you be inheriting from Zend_Controller_Action not Zend_Controller_Front?

also the word 'action' is not a valid php keyword?

just use the view helper in your view script, so in abc/page1.phtml

print $this->page1Helper()

similarly for page2 and page3

but there may be an easier way... you can just

print $this->form;

and the form will print without the need for a helper?

Steve